diff --git a/tests/regressiontests/admin_inlines/tests.py b/tests/regressiontests/admin_inlines/tests.py
index 5bb6077bff..3c868012fa 100644
--- a/tests/regressiontests/admin_inlines/tests.py
+++ b/tests/regressiontests/admin_inlines/tests.py
@@ -131,19 +131,17 @@ class TestInline(TestCase):
response = self.client.get('/admin/admin_inlines/capofamiglia/add/')
self.assertContains(response,
- '')
+ '', html=True)
self.assertContains(response,
- '')
+ '', html=True)
self.assertContains(response,
'', html=True)
self.assertContains(response,
- '')
+ '', html=True)
self.assertContains(response,
- '')
+ '', html=True)
self.assertContains(response,
'', html=True)
@@ -326,7 +324,8 @@ class TestInlinePermissions(TestCase):
# Add permission on inner2s, so we get the inline
self.assertContains(response, '
Inner2s
')
self.assertContains(response, 'Add another Inner2')
- self.assertContains(response, 'value="3" id="id_inner2_set-TOTAL_FORMS"')
+ self.assertContains(response, '', html=True)
def test_inline_change_m2m_add_perm(self):
permission = Permission.objects.get(codename='add_book', content_type=self.book_ct)
@@ -345,8 +344,10 @@ class TestInlinePermissions(TestCase):
# We have change perm on books, so we can add/change/delete inlines
self.assertContains(response, '
')
self.assertContains(response, 'Add another Inner2')
# 3 extra forms only, not the existing instance form
- self.assertContains(response, 'value="3" id="id_inner2_set-TOTAL_FORMS"')
- self.assertNotContains(response, '', html=True)
+ self.assertNotContains(response, '' % self.inner2_id, html=True)
def test_inline_change_fk_change_perm(self):
permission = Permission.objects.get(codename='change_inner2', content_type=self.inner_ct)
@@ -367,10 +370,13 @@ class TestInlinePermissions(TestCase):
# Change permission on inner2s, so we can change existing but not add new
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, '', html=True)
+ self.assertContains(response, '' % self.inner2_id, html=True)
# max-num 0 means we can't add new ones
- self.assertContains(response, 'value="0" id="id_inner2_set-MAX_NUM_FORMS"')
+ self.assertContains(response, '', html=True)
def test_inline_change_fk_add_change_perm(self):
permission = Permission.objects.get(codename='add_inner2', content_type=self.inner_ct)
@@ -381,9 +387,10 @@ class TestInlinePermissions(TestCase):
# Add/change perm, so we can add new and change existing
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, '', html=True)
+ self.assertContains(response, '' % self.inner2_id, html=True)
def test_inline_change_fk_change_del_perm(self):
permission = Permission.objects.get(codename='change_inner2', content_type=self.inner_ct)
@@ -394,8 +401,10 @@ class TestInlinePermissions(TestCase):
# Change/delete perm on inner2s, so we can change/delete existing
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, '', html=True)
+ self.assertContains(response, '' % self.inner2_id, html=True)
self.assertContains(response, 'id="id_inner2_set-0-DELETE"')
@@ -410,8 +419,10 @@ class TestInlinePermissions(TestCase):
# All perms on inner2s, so we can add/change/delete
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, '', html=True)
+ self.assertContains(response, '' % self.inner2_id, html=True)
self.assertContains(response, 'id="id_inner2_set-0-DELETE"')