mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #33302 -- Made element_id optional argument for json_script template filter.
Added versionchanged note in documentation
This commit is contained in:
parent
dd528cb2ce
commit
e6e664a711
6 changed files with 28 additions and 9 deletions
|
@ -173,6 +173,12 @@ class TestUtilsHtml(SimpleTestCase):
|
|||
with self.subTest(arg=arg):
|
||||
self.assertEqual(json_script(arg, 'test_id'), expected)
|
||||
|
||||
def test_json_script_without_id(self):
|
||||
self.assertHTMLEqual(
|
||||
json_script({'key': 'value'}),
|
||||
'<script type="application/json">{"key": "value"}</script>',
|
||||
)
|
||||
|
||||
def test_smart_urlquote(self):
|
||||
items = (
|
||||
('http://öäü.com/', 'http://xn--4ca9at.com/'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue