1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #34657 -- Made assertInHTML() use unparsed needle in error messages.

This commit is contained in:
Chinmoy Chakraborty
2023-09-29 09:48:45 +02:00
committed by Mariusz Felisiak
parent 6ad0dbc8d9
commit e99c7d8847
3 changed files with 11 additions and 3 deletions

View File

@@ -983,6 +983,13 @@ class HTMLEqualTests(SimpleTestCase):
)
class InHTMLTests(SimpleTestCase):
def test_needle_msg(self):
msg = "False is not true : Couldn't find '<b>Hello</b>' in response"
with self.assertRaisesMessage(AssertionError, msg):
self.assertInHTML("<b>Hello</b>", "<p>Test</p>")
class JSONEqualTests(SimpleTestCase):
def test_simple_equal(self):
json1 = '{"attr1": "foo", "attr2":"baz"}'