MCPcopy Index your code
hub / github.com/django/django / test_assert_not_in_html

Method test_assert_not_in_html

tests/test_utils/tests.py:1134–1142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1132 self.assertInHTML("<b>This</b>", haystack, 3)
1133
1134 def test_assert_not_in_html(self):
1135 haystack = "<p><b>Hello</b> <span>there</span>! Hi <span>there</span>!</p>"
1136 self.assertNotInHTML("<b>Hi</b>", haystack=haystack)
1137 msg = (
1138 "'<b>Hello</b>' unexpectedly found in the following response"
1139 f"\n{haystack!r}"
1140 )
1141 with self.assertRaisesMessage(AssertionError, msg):
1142 self.assertNotInHTML("<b>Hello</b>", haystack=haystack)
1143
1144 def test_assert_not_in_html_msg_prefix(self):
1145 haystack = "<p>Hello</p>"

Callers

nothing calls this directly

Calls 2

assertNotInHTMLMethod · 0.80
assertRaisesMessageMethod · 0.80

Tested by

no test coverage detected