X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=quotes%2Ftests.py;h=2a7bc4502ae84b04ce160ced0f6290c2bf03d6e7;hb=1403f44199bde09f56e466285e00462e88e344fd;hp=556e9252c3377477911b077da4e64315b8f067b9;hpb=af3f857eea25b939f927832741f377e4de401f9c;p=djsite.git diff --git a/quotes/tests.py b/quotes/tests.py index 556e925..2a7bc45 100644 --- a/quotes/tests.py +++ b/quotes/tests.py @@ -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)