diff options
author | luxagraf <sng@luxagraf.net> | 2018-11-14 13:17:42 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-11-14 13:17:42 -0600 |
commit | a0b95dc2dfb84c682bb8f677e5d471f84e5028fe (patch) | |
tree | 6dd1919856f736c5b644270d59b57e4bb20336c5 /apps/notes/tests/test_models.py |
wrote out basic notes skeleton
Diffstat (limited to 'apps/notes/tests/test_models.py')
-rw-r--r-- | apps/notes/tests/test_models.py | 30 |
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") |