Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 56f3ed7f5425746f16f4027cceb7b9059806478d 1 parent a00be66
@mboersma mboersma authored
Showing with 11 additions and 12 deletions.
  1. +11 −12 tests/regressiontests/admin_views/tests.py
View
23 tests/regressiontests/admin_views/tests.py
@@ -13,11 +13,10 @@
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 @@ def test_char_pk_inline(self):
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 @@ def test_char_pk_inline(self):
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 @@ def test_char_pk_inline(self):
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 @@ def test_integer_pk_inline(self):
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 @@ def test_integer_pk_inline(self):
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"
Please sign in to comment.
Something went wrong with that request. Please try again.