- response = c.get('/quotes/author/%s/' % q.author.id)
- self.assertEqual(response.status_code, 200)
- self.assertFalse('Quote01, two tags' in response.content)
- self.assertTrue('Quote02' in response.content)
+ authorpage = self.getPage('author/%s/' % q.author.id)
+ self.assertTrue(q.text in authorpage)
+ self.assertFalse("author_notes" in authorpage)
+ self.assertFalse('Quote01, two tags' in authorpage)
+
+ 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]
+
+ authorpage = self.getPage('author/%s/' % a.id)
+ self.assertEqual(authorpage.count("Some notes"), 1)