From ec9fac9c1371f9b8ccb660e0a615c5b93e55ddfc Mon Sep 17 00:00:00 2001 From: Renato Oliveira Date: Mon, 11 Dec 2017 17:43:54 -0200 Subject: [PATCH] Remove tests that used the foreign key. Remove print statement on children note return. --- notto/nottoapp/models.py | 1 - notto/nottoapp/tests.py | 25 ------------------------- 2 files changed, 26 deletions(-) diff --git a/notto/nottoapp/models.py b/notto/nottoapp/models.py index b9d6f75..b11d560 100644 --- a/notto/nottoapp/models.py +++ b/notto/nottoapp/models.py @@ -38,7 +38,6 @@ def get_children(self): children = Note.objects.filter( url_title__startswith=self.url_title+'/' ) - print(children) return children def has_parent(self): diff --git a/notto/nottoapp/tests.py b/notto/nottoapp/tests.py index bdda7e4..739fe1d 100644 --- a/notto/nottoapp/tests.py +++ b/notto/nottoapp/tests.py @@ -29,31 +29,6 @@ def setUp(self): content='I\'m sad' ) - def test_get_children(self): - ''' - Tests if the note is able to list its children, if they exist. - If they don't exist, then return an empty list. - ''' - parent = Note.objects.get(url_title='parent') - loose_note = Note.objects.get(url_title='lonely_note') - children = parent.get_children() - self.assertEqual(1, len(children)) - children = loose_note.get_children() - self.assertEqual(0, len(children)) - - def test_get_parent(self): - ''' - Tests if the note is able to get its parent record, if it exists. - If it doesn't exist, then return None. - ''' - child = Note.objects.get(url_title='parent/child') - parent = child.get_parent() - loose_note = Note.objects.get(url_title='lonely_note') - self.assertNotEqual(None, parent) - self.assertEqual('parent', parent.url_title) - parent = loose_note.get_parent() - self.assertEqual(None, parent) - class NoteAccessTest(TestCase): ''' Tests of access using URLs