From 6a1e5dde9ba28802a03c8a0a61c1dc13e2252c31 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 21 Oct 2011 11:36:23 +0200 Subject: [PATCH] added a test --- apps/catalogue/tests/book_import.py | 9 +++++++++ requirements-test.txt | 1 + 2 files changed, 10 insertions(+) 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 -- 2.20.1