added a test
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 21 Oct 2011 09:36:23 +0000 (11:36 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 21 Oct 2011 09:36:23 +0000 (11:36 +0200)
apps/catalogue/tests/book_import.py
requirements-test.txt

index 66487d8..f65d880 100644 (file)
@@ -211,6 +211,15 @@ class ChildImportTests(WLTestCase):
             **info_args("Parent")
         )
 
+    def test_child(self):
+        TEXT = """<utwor />"""
+        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 = """<utwor />"""
         CHILD_TEXT = """<utwor>
index 78e246a..e8c7db6 100644 (file)
@@ -1,2 +1,3 @@
 nose>=0.11
 django-nose
+nosexcover