]> gitweb.fperrin.net Git - djsite.git/blobdiff - quotes/tests.py
On the author page, don't display the author notes for each quote
[djsite.git] / quotes / tests.py
index 556e9252c3377477911b077da4e64315b8f067b9..2a7bc4502ae84b04ce160ced0f6290c2bf03d6e7 100644 (file)
@@ -66,3 +66,15 @@ class ViewsTest(TestCase):
         self.assertEqual(response.status_code, 200)
         self.assertFalse('Quote01, two tags' in response.content)
         self.assertTrue('Quote02' in response.content)
+
+    def test_view_author_notes_once(self):
+        # check that on the per-author view, the author notes aren't display
+        # for every quote
+        a = Author.objects.filter(name="Author with notes")
+        self.assertEqual(a.count(), 1)
+        a = a[0]
+
+        c = Client()
+        response = c.get('/quotes/author/%s/' % a.id)
+        self.assertEqual(response.status_code, 200)
+        self.assertEqual(response.content.count("Some notes"), 1)