From a973fb2d68f2e23e599a601fdaec13d129207e9f Mon Sep 17 00:00:00 2001 From: Adam Alton Date: Tue, 25 Nov 2014 11:07:22 +0000 Subject: [PATCH] Fixed and restored assertions in OneToOneTests.test_foreign_key. These assertions had been removed in 34ba86706f and 7fe554b2a3, seemingly because they were referencing the wrong objects, and so they started failing when the checking of object types (as well as PK values) was introduced. --- tests/one_to_one/tests.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/one_to_one/tests.py b/tests/one_to_one/tests.py index f59749f8cf..72d279b83c 100644 --- a/tests/one_to_one/tests.py +++ b/tests/one_to_one/tests.py @@ -96,12 +96,15 @@ class OneToOneTests(TestCase): assert_filter_waiters(restaurant__place__exact=self.p1.pk) assert_filter_waiters(restaurant__place__exact=self.p1) assert_filter_waiters(restaurant__place__pk=self.p1.pk) - assert_filter_waiters(restaurant__exact=self.p1.pk) - assert_filter_waiters(restaurant__pk=self.p1.pk) - assert_filter_waiters(restaurant=self.p1.pk) + assert_filter_waiters(restaurant__exact=self.r1.pk) + assert_filter_waiters(restaurant__exact=self.r1) + assert_filter_waiters(restaurant__pk=self.r1.pk) + assert_filter_waiters(restaurant=self.r1.pk) assert_filter_waiters(restaurant=self.r1) + assert_filter_waiters(id__exact=w.pk) + assert_filter_waiters(pk=w.pk) # Delete the restaurant; the waiter should also be removed - r = Restaurant.objects.get(pk=self.p1.pk) + r = Restaurant.objects.get(pk=self.r1.pk) r.delete() self.assertEqual(Waiter.objects.count(), 0)