summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Boersma <matt@sprout.org>2009-05-15 15:01:40 +0000
committerMatt Boersma <matt@sprout.org>2009-05-15 15:01:40 +0000
commit56f3ed7f5425746f16f4027cceb7b9059806478d (patch)
tree73af44f3e4d729f374bf085129ce1f7f94adc600
parenta00be663112bc674f71492717f7bbbb35b922e42 (diff)
downloaddjango-56f3ed7f5425746f16f4027cceb7b9059806478d.tar.gz
Fixed import statement in admin_views test to work with Python 2.3.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10789 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/admin_views/tests.py23
1 files changed, 11 insertions, 12 deletions
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"