summaryrefslogtreecommitdiff
path: root/tests/test_utils/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_utils/tests.py')
-rw-r--r--tests/test_utils/tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py
index 494a0ea8d3..37e87aa102 100644
--- a/tests/test_utils/tests.py
+++ b/tests/test_utils/tests.py
@@ -1083,6 +1083,15 @@ class InHTMLTests(SimpleTestCase):
with self.assertRaisesMessage(AssertionError, msg):
self.assertNotInHTML("<b>Hello</b>", haystack=haystack)
+ def test_assert_not_in_html_msg_prefix(self):
+ haystack = "<p>Hello</p>"
+ msg = (
+ "1 != 0 : Prefix: '<p>Hello</p>' unexpectedly found in the following "
+ f"response\n{haystack!r}"
+ )
+ with self.assertRaisesMessage(AssertionError, msg):
+ self.assertNotInHTML("<p>Hello</p>", haystack=haystack, msg_prefix="Prefix")
+
class JSONEqualTests(SimpleTestCase):
def test_simple_equal(self):