a1 = Author.objects.create(name="JFK")
w1 = Work.objects.create(name="Berlin speech", author=a1)
q1 = Quote.objects.create(text="Ich bin...", work=w1)
+ self.q1 = q1
def test_one(self):
q = Quote.objects.filter(text__startswith="Ich")
self.assertEqual(q.count(), 1)
q = q[0]
+ self.assertEqual(q, self.q1)
self.assertEqual(q.work.author.name, "JFK")
class ViewsTest(TestCase):