From: Radek Czajka Date: Fri, 21 Oct 2011 09:36:23 +0000 (+0200) Subject: added a test X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/6a1e5dde9ba28802a03c8a0a61c1dc13e2252c31?ds=sidebyside added a test --- diff --git a/apps/catalogue/tests/book_import.py b/apps/catalogue/tests/book_import.py index 66487d899..f65d8807a 100644 --- a/apps/catalogue/tests/book_import.py +++ b/apps/catalogue/tests/book_import.py @@ -211,6 +211,15 @@ class ChildImportTests(WLTestCase): **info_args("Parent") ) + def test_child(self): + TEXT = """""" + child = models.Book.from_text_and_meta(ContentFile(TEXT), self.child_info) + parent = models.Book.from_text_and_meta(ContentFile(TEXT), self.parent_info) + author = parent.tags.get(category='author') + books = self.client.get(author.get_absolute_url()).context['object_list'] + self.assertEqual(len(books), 1, + "Only parent book should be visible on author's page") + def test_child_replace(self): PARENT_TEXT = """""" CHILD_TEXT = """ diff --git a/requirements-test.txt b/requirements-test.txt index 78e246a0d..e8c7db60e 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,2 +1,3 @@ nose>=0.11 django-nose +nosexcover