summaryrefslogtreecommitdiff
path: root/tests/admin_views
diff options
context:
space:
mode:
authorJacob Rief <jacob.rief@gmail.com>2016-11-05 12:47:12 +0100
committerTim Graham <timograham@gmail.com>2016-11-12 10:02:57 -0500
commitb3162cab94ca2988c99afe01887a4b61d6a35c1a (patch)
treeead0944f5031b842c4dcebcc1f9172ce1f5b074f /tests/admin_views
parenta17fe73d2d3adc399b388dc6593b9af6a7c9d522 (diff)
Fixed #27386 -- Wrapped admin's readonly fields in <div> rather than <p>.
Diffstat (limited to 'tests/admin_views')
-rw-r--r--tests/admin_views/tests.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index 0643448984..ae66e2e508 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -4598,11 +4598,15 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
self.assertContains(response, "foo")
# Multiline text in a readonly field gets <br /> tags
- self.assertContains(response, "Multiline<br />test<br />string")
- self.assertContains(response, "<p>Multiline<br />html<br />content</p>", html=True)
- self.assertContains(response, "InlineMultiline<br />test<br />string")
+ self.assertContains(response, 'Multiline<br />test<br />string')
+ self.assertContains(response, '<div class="readonly">Multiline<br />html<br />content</div>', html=True)
+ self.assertContains(response, 'InlineMultiline<br />test<br />string')
# Remove only this last line when the deprecation completes.
- self.assertContains(response, "<p>Multiline<br />html<br />content<br />with allow tags</p>", html=True)
+ self.assertContains(
+ response,
+ '<div class="readonly">Multiline<br />html<br />content<br />with allow tags</div>',
+ html=True
+ )
self.assertContains(response, formats.localize(datetime.date.today() - datetime.timedelta(days=7)))
@@ -4685,8 +4689,7 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
"""
choice = Choice.objects.create(choice=None)
response = self.client.get(reverse('admin:admin_views_choice_change', args=(choice.pk,)))
- self.assertContains(response, '<p>No opinion</p>', html=True)
- self.assertNotContains(response, '<p>(None)</p>')
+ self.assertContains(response, '<div class="readonly">No opinion</div>', html=True)
def test_readonly_manytomany_backwards_ref(self):
"""
@@ -4705,7 +4708,7 @@ class ReadonlyTest(AdminFieldExtractionMixin, TestCase):
pizza.toppings.add(topping)
response = self.client.get(reverse('admin:admin_views_pizza_change', args=(pizza.pk,)))
self.assertContains(response, '<label>Toppings:</label>', html=True)
- self.assertContains(response, '<p>Salami</p>', html=True)
+ self.assertContains(response, '<div class="readonly">Salami</div>', html=True)
def test_readonly_onetoone_backwards_ref(self):
"""