MCPcopy
hub / github.com/django/django / test_complex_examples

Method test_complex_examples

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

Source from the content-addressed store, hash-verified

859 self.assertHTMLEqual(*pair)
860
861 def test_complex_examples(self):
862 self.assertHTMLEqual(
863 """<tr><th><label for="id_first_name">First name:</label></th>
864<td><input type="text" name="first_name" value="John" id="id_first_name" /></td></tr>
865<tr><th><label for="id_last_name">Last name:</label></th>
866<td><input type="text" id="id_last_name" name="last_name" value="Lennon" /></td></tr>
867<tr><th><label for="id_birthday">Birthday:</label></th>
868<td><input type="text" value="1940-10-9" name="birthday" id="id_birthday" /></td></tr>""", # NOQA
869 """
870 <tr><th>
871 <label for="id_first_name">First name:</label></th><td>
872 <input type="text" name="first_name" value="John" id="id_first_name" />
873 </td></tr>
874 <tr><th>
875 <label for="id_last_name">Last name:</label></th><td>
876 <input type="text" name="last_name" value="Lennon" id="id_last_name" />
877 </td></tr>
878 <tr><th>
879 <label for="id_birthday">Birthday:</label></th><td>
880 <input type="text" name="birthday" value="1940-10-9" id="id_birthday" />
881 </td></tr>
882 """,
883 )
884
885 self.assertHTMLEqual(
886 """<!DOCTYPE html>
887 <html>
888 <head>
889 <link rel="stylesheet">
890 <title>Document</title>
891 <meta attribute="value">
892 </head>
893 <body>
894 <p>
895 This is a valid paragraph
896 <div> this is a div AFTER the p</div>
897 </body>
898 </html>""",
899 """
900 <html>
901 <head>
902 <link rel="stylesheet">
903 <title>Document</title>
904 <meta attribute="value">
905 </head>
906 <body>
907 <p> This is a valid paragraph
908 <!-- browsers would close the p tag here -->
909 <div> this is a div AFTER the p</div>
910 </p> <!-- this is invalid HTML parsing, but it should make no
911 difference in most cases -->
912 </body>
913 </html>""",
914 )
915
916 def test_html_contain(self):
917 # equal html contains each other

Callers

nothing calls this directly

Calls 1

assertHTMLEqualMethod · 0.80

Tested by

no test coverage detected