From 39b3269fec788bebf900081d26b94eccad6d086b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 4 Jan 2011 05:57:32 +0000 Subject: [PATCH] Corrected a test failure under Postgres caused by PK allocation. Thanks to Alex for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15147 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/generic_views/edit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/regressiontests/generic_views/edit.py b/tests/regressiontests/generic_views/edit.py index c7c422b244..075cf3e551 100644 --- a/tests/regressiontests/generic_views/edit.py +++ b/tests/regressiontests/generic_views/edit.py @@ -41,7 +41,8 @@ class CreateViewTests(TestCase): res = self.client.post('/edit/artists/create/', {'name': 'Rene Magritte'}) self.assertEqual(res.status_code, 302) - self.assertRedirects(res, 'http://testserver/detail/artist/1/') + artist = Artist.objects.get(name='Rene Magritte') + self.assertRedirects(res, 'http://testserver/detail/artist/%d/' % artist.pk) self.assertQuerysetEqual(Artist.objects.all(), ['']) def test_create_with_redirect(self):