MCPcopy
hub / github.com/django/django / assertHTMLNotEqual

Method assertHTMLNotEqual

django/test/testcases.py:979–990  ·  view source on GitHub ↗

Assert that two HTML snippets are not semantically equivalent.

(self, html1, html2, msg=None)

Source from the content-addressed store, hash-verified

977 self.fail(self._formatMessage(msg, standardMsg))
978
979 def assertHTMLNotEqual(self, html1, html2, msg=None):
980 """Assert that two HTML snippets are not semantically equivalent."""
981 dom1 = assert_and_parse_html(
982 self, html1, msg, "First argument is not valid HTML:"
983 )
984 dom2 = assert_and_parse_html(
985 self, html2, msg, "Second argument is not valid HTML:"
986 )
987
988 if dom1 == dom2:
989 standardMsg = "%s == %s" % (safe_repr(dom1, True), safe_repr(dom2, True))
990 self.fail(self._formatMessage(msg, standardMsg))
991
992 def assertInHTML(self, needle, haystack, count=None, msg_prefix=""):
993 parsed_needle = assert_and_parse_html(

Callers 4

test_unequal_htmlMethod · 0.80
test_attributesMethod · 0.80

Calls 1

assert_and_parse_htmlFunction · 0.85

Tested by

no test coverage detected