aboutsummaryrefslogtreecommitdiff
path: root/apps/notes/tests/test_models.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/notes/tests/test_models.py')
-rw-r--r--apps/notes/tests/test_models.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/apps/notes/tests/test_models.py b/apps/notes/tests/test_models.py
new file mode 100644
index 0000000..e6cdb6a
--- /dev/null
+++ b/apps/notes/tests/test_models.py
@@ -0,0 +1,30 @@
+from django.test import TestCase
+from mixer.backend.django import mixer
+
+from notes.models import Note, Folder
+from accounts.models import User
+
+
+class FolderModelTest(TestCase):
+
+ def test_string_representation(self):
+ user = mixer.blend(User, username='tpynchon')
+ folder = Folder(created_by=user, name="My Folder")
+ self.assertEqual(str(folder), "My Folder")
+
+
+class NoteModelTest(TestCase):
+
+ def test_string_representation(self):
+ user = mixer.blend(User, username='test')
+ note = Note(
+ created_by=user,
+ title="test note",
+ body_markdown="the body of the note",
+ url="https://luxagraf.net/",
+ tags="mine,cool site"
+ )
+ self.assertEqual(str(note), "test note")
+ self.assertEqual(str(note.body_markdown), "the body of the note")
+ self.assertEqual(str(note.url), "https://luxagraf.net/")
+ self.assertEqual(str(note.tags), "mine,cool site")