From 8b801a7553f28c028fd8f602e9c5e86580600d8e Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Tue, 11 Oct 2011 21:55:45 +0000 Subject: [PATCH] Fixed some tests from r16934 to be auto-id-independent. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16960 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/admin_inlines/tests.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/regressiontests/admin_inlines/tests.py b/tests/regressiontests/admin_inlines/tests.py index 7ab5ba6478..619c2bf3b4 100644 --- a/tests/regressiontests/admin_inlines/tests.py +++ b/tests/regressiontests/admin_inlines/tests.py @@ -230,12 +230,14 @@ class TestInlinePermissions(TestCase): self.user.user_permissions.add(permission) author = Author.objects.create(pk=1, name=u'The Author') - author.books.create(name=u'The inline Book') + book = author.books.create(name=u'The inline Book') self.author_change_url = '/admin/admin_inlines/author/%i/' % author.id + self.book_id = book.id holder = Holder2.objects.create(dummy=13) - Inner2.objects.create(dummy=42, holder=holder) + inner2 = Inner2.objects.create(dummy=42, holder=holder) self.holder_change_url = '/admin/admin_inlines/holder2/%i/' % holder.id + self.inner2_id = inner2.id self.assertEqual( self.client.login(username='admin', password='secret'), @@ -308,7 +310,7 @@ class TestInlinePermissions(TestCase): self.assertContains(response, '

Author-book relationships

') self.assertContains(response, 'Add another Author-Book Relationship') self.assertContains(response, 'value="4" id="id_Author_books-TOTAL_FORMS"') - self.assertContains(response, 'Inner2s') # Just the one form for existing instances self.assertContains(response, 'value="1" id="id_inner2_set-TOTAL_FORMS"') - self.assertContains(response, 'Inner2s') # One form for existing instance and three extra for new self.assertContains(response, 'value="4" id="id_inner2_set-TOTAL_FORMS"') - self.assertContains(response, 'Inner2s') # One form for existing instance only, no new self.assertContains(response, 'value="1" id="id_inner2_set-TOTAL_FORMS"') - self.assertContains(response, 'Inner2s') # One form for existing instance only, three for new self.assertContains(response, 'value="4" id="id_inner2_set-TOTAL_FORMS"') - self.assertContains(response, '