mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #35728 -- Computed error messages in assertions only on test failures.
Performance regression in 1dae65dc63.
Thanks to Adam Johnson for the report.
This commit is contained in:
committed by
Sarah Boyce
parent
04e813cd17
commit
449b9f9aee
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user