(self)
| 1116 | self.assertInHTML("<b>Hello</b>", haystack=haystack, count=2) |
| 1117 | |
| 1118 | def test_long_haystack(self): |
| 1119 | haystack = ( |
| 1120 | "<p>This is a very very very very very very very very long message which " |
| 1121 | "exceeds the max limit of truncation.</p>" |
| 1122 | ) |
| 1123 | msg = f"Couldn't find '<b>Hello</b>' in the following response\n{haystack!r}" |
| 1124 | with self.assertRaisesMessage(AssertionError, msg): |
| 1125 | self.assertInHTML("<b>Hello</b>", haystack) |
| 1126 | |
| 1127 | msg = ( |
| 1128 | "Found 0 instances of '<b>This</b>' (expected 3) in the following response" |
| 1129 | f"\n{haystack!r}" |
| 1130 | ) |
| 1131 | with self.assertRaisesMessage(AssertionError, msg): |
| 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>" |
nothing calls this directly
no test coverage detected