From f96f63056bfe5ee799b82fe808c2e84286b7a302 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 17 Dec 2009 23:47:45 +0000 Subject: [PATCH] Fixed #12393 -- Parameterized the form output in the testGenericInlineFormset test to avoid database PK problems. Thanks to Karen for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11905 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/generic_inline_admin/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/regressiontests/generic_inline_admin/tests.py b/tests/regressiontests/generic_inline_admin/tests.py index 83542d1528..75f3e4aaae 100644 --- a/tests/regressiontests/generic_inline_admin/tests.py +++ b/tests/regressiontests/generic_inline_admin/tests.py @@ -89,22 +89,22 @@ class GenericAdminViewTest(TestCase): # Works with no queryset formset = EpisodeMediaFormSet(instance=e) self.assertEquals(len(formset.forms), 5) - self.assertEquals(formset.forms[0].as_p(), '

') - self.assertEquals(formset.forms[1].as_p(), '

') + self.assertEquals(formset.forms[0].as_p(), '

' % self.mp3_media_pk) + self.assertEquals(formset.forms[1].as_p(), '

' % self.png_media_pk) self.assertEquals(formset.forms[2].as_p(), '

') # A queryset can be used to alter display ordering formset = EpisodeMediaFormSet(instance=e, queryset=Media.objects.order_by('url')) self.assertEquals(len(formset.forms), 5) - self.assertEquals(formset.forms[0].as_p(), '

') - self.assertEquals(formset.forms[1].as_p(), '

') + self.assertEquals(formset.forms[0].as_p(), '

' % self.png_media_pk) + self.assertEquals(formset.forms[1].as_p(), '

' % self.mp3_media_pk) self.assertEquals(formset.forms[2].as_p(), '

') # Works with a queryset that omits items formset = EpisodeMediaFormSet(instance=e, queryset=Media.objects.filter(url__endswith=".png")) self.assertEquals(len(formset.forms), 4) - self.assertEquals(formset.forms[0].as_p(), '

') + self.assertEquals(formset.forms[0].as_p(), '

' % self.png_media_pk) self.assertEquals(formset.forms[1].as_p(), '

')