mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[5.1.x] Refs #34609 -- Fixed deprecation warning stack level in format_html().
Co-authored-by: Simon Charette <charette.s@gmail.com>
Backport of 2b71b2c8dc from main.
This commit is contained in:
@@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user