diff options
| author | Adam Johnson <me@adamj.eu> | 2024-08-27 19:14:50 +0100 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2024-08-27 15:17:47 -0300 |
| commit | 03e0ab5c64d4bc09c6932268b29efcc789a0f7af (patch) | |
| tree | 0859946c27fef71e1c6f0edbf481f70273759792 /tests/utils_tests | |
| parent | f362c3dea239b9903c35aff66412747c5cb8e933 (diff) | |
[5.1.x] Refs #34609 -- Fixed deprecation warning stack level in format_html().
Co-authored-by: Simon Charette <charette.s@gmail.com>
Backport of 2b71b2c8dcd40f2604310bb3914077320035b399 from main.
Diffstat (limited to 'tests/utils_tests')
| -rw-r--r-- | tests/utils_tests/test_html.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py index 82dbd58f12..10ba621dd5 100644 --- a/tests/utils_tests/test_html.py +++ b/tests/utils_tests/test_html.py @@ -70,10 +70,11 @@ class TestUtilsHtml(SimpleTestCase): msg = "Calling format_html() without passing args or kwargs is deprecated." # RemovedInDjango60Warning: when the deprecation ends, replace with: # msg = "args or kwargs must be provided." - # with self.assertRaisesMessage(ValueError, msg): - with self.assertWarnsMessage(RemovedInDjango60Warning, msg): + # with self.assertRaisesMessage(TypeError, msg): + with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx: name = "Adam" self.assertEqual(format_html(f"<i>{name}</i>"), "<i>Adam</i>") + self.assertEqual(ctx.filename, __file__) def test_linebreaks(self): items = ( |
