diff options
| author | Chinmoy Chakraborty <chinmoy12c@gmail.com> | 2023-09-29 09:48:45 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-09-29 09:52:39 +0200 |
| commit | e99c7d8847e9006f877ab3cea47f1977652af71f (patch) | |
| tree | 3cc1f93b91773efc6d12f3a9b94c847b15ec50fd /tests/test_utils | |
| parent | 6ad0dbc8d90ef37731608f7ac3d6e1d62cc8c765 (diff) | |
Refs #34657 -- Made assertInHTML() use unparsed needle in error messages.
Diffstat (limited to 'tests/test_utils')
| -rw-r--r-- | tests/test_utils/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_utils/tests.py b/tests/test_utils/tests.py index 8b07d631fb..3ee78a60a3 100644 --- a/tests/test_utils/tests.py +++ b/tests/test_utils/tests.py @@ -983,6 +983,13 @@ class HTMLEqualTests(SimpleTestCase): ) +class InHTMLTests(SimpleTestCase): + def test_needle_msg(self): + msg = "False is not true : Couldn't find '<b>Hello</b>' in response" + with self.assertRaisesMessage(AssertionError, msg): + self.assertInHTML("<b>Hello</b>", "<p>Test</p>") + + class JSONEqualTests(SimpleTestCase): def test_simple_equal(self): json1 = '{"attr1": "foo", "attr2":"baz"}' |
