diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py index 4f2a503b4f..8e7010be9f 100644 --- a/tests/regressiontests/admin_views/tests.py +++ b/tests/regressiontests/admin_views/tests.py @@ -13,11 +13,10 @@ from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.utils.html import escape # local test models -from models import (Article, BarAccount, CustomArticle, EmptyModel, - ExternalSubscriber, FooAccount, Gallery, - ModelWithStringPrimaryKey, Person, Persona, Picture, - Podcast, Section, Subscriber, Vodcast, Language, - Collector, Widget, Grommet, DooHickey, FancyDoodad, Whatsit) +from models import Article, BarAccount, CustomArticle, EmptyModel, \ + ExternalSubscriber, FooAccount, Gallery, ModelWithStringPrimaryKey, \ + Person, Persona, Picture, Podcast, Section, Subscriber, Vodcast, \ + Language, Collector, Widget, Grommet, DooHickey, FancyDoodad, Whatsit try: set @@ -1335,11 +1334,11 @@ class AdminInlineTests(TestCase): self.failUnlessEqual(response.status_code, 302) self.failUnlessEqual(DooHickey.objects.count(), 1) self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1") - + # Check that the PK link exists on the rendered form response = self.client.get('/test_admin/admin/admin_views/collector/1/') self.assertContains(response, 'name="doohickey_set-0-code"') - + # Now resave that inline self.post_data['doohickey_set-INITIAL_FORMS'] = "1" self.post_data['doohickey_set-0-code'] = "DH1" @@ -1348,7 +1347,7 @@ class AdminInlineTests(TestCase): self.failUnlessEqual(response.status_code, 302) self.failUnlessEqual(DooHickey.objects.count(), 1) self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1") - + # Now modify that inline self.post_data['doohickey_set-INITIAL_FORMS'] = "1" self.post_data['doohickey_set-0-code'] = "DH1" @@ -1357,7 +1356,7 @@ class AdminInlineTests(TestCase): self.failUnlessEqual(response.status_code, 302) self.failUnlessEqual(DooHickey.objects.count(), 1) self.failUnlessEqual(DooHickey.objects.all()[0].name, "Doohickey 1 Updated") - + def test_integer_pk_inline(self): "A model with an integer PK can be saved as inlines. Regression for #10992" # First add a new inline @@ -1367,11 +1366,11 @@ class AdminInlineTests(TestCase): self.failUnlessEqual(response.status_code, 302) self.failUnlessEqual(Whatsit.objects.count(), 1) self.failUnlessEqual(Whatsit.objects.all()[0].name, "Whatsit 1") - + # Check that the PK link exists on the rendered form response = self.client.get('/test_admin/admin/admin_views/collector/1/') self.assertContains(response, 'name="whatsit_set-0-index"') - + # Now resave that inline self.post_data['whatsit_set-INITIAL_FORMS'] = "1" self.post_data['whatsit_set-0-index'] = "42" @@ -1380,7 +1379,7 @@ class AdminInlineTests(TestCase): self.failUnlessEqual(response.status_code, 302) self.failUnlessEqual(Whatsit.objects.count(), 1) self.failUnlessEqual(Whatsit.objects.all()[0].name, "Whatsit 1") - + # Now modify that inline self.post_data['whatsit_set-INITIAL_FORMS'] = "1" self.post_data['whatsit_set-0-index'] = "42"