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, '