From 5f8332af049efc878a4c906e75e90708e90830b3 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 12 Oct 2010 01:02:57 +0000 Subject: [PATCH] [1.2.X] Tweak to many_to_one_null doctest to avoid primary key assumptions (causing breakage on PostgreSQL). Backport of r14168 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14174 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/many_to_one_null/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modeltests/many_to_one_null/tests.py b/tests/modeltests/many_to_one_null/tests.py index 6b7b0a7413..c78f980871 100644 --- a/tests/modeltests/many_to_one_null/tests.py +++ b/tests/modeltests/many_to_one_null/tests.py @@ -40,7 +40,7 @@ class ManyToOneNullTests(TestCase): def test_created_without_related(self): self.assertEqual(self.a3.reporter, None) # Need to reget a3 to refresh the cache - a3 = Article.objects.get(pk=3) + a3 = Article.objects.get(pk=self.a3.pk) self.assertRaises(AttributeError, getattr, a3.reporter, 'id') # Accessing an article's 'reporter' attribute returns None # if the reporter is set to None.