mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #33631 -- Marked {% blocktranslate asvar %} result as HTML safe.
This commit is contained in:
@@ -416,6 +416,22 @@ class I18nBlockTransTagTests(SimpleTestCase):
|
||||
output = self.engine.render_to_string("i18n41")
|
||||
self.assertEqual(output, ">Error: Seite nicht gefunden<")
|
||||
|
||||
@setup(
|
||||
{
|
||||
"i18n_asvar_safestring": (
|
||||
"{% load i18n %}"
|
||||
"{% blocktranslate asvar the_title %}"
|
||||
"{{title}}other text"
|
||||
"{% endblocktranslate %}"
|
||||
"{{ the_title }}"
|
||||
)
|
||||
}
|
||||
)
|
||||
def test_i18n_asvar_safestring(self):
|
||||
context = {"title": "<Main Title>"}
|
||||
output = self.engine.render_to_string("i18n_asvar_safestring", context=context)
|
||||
self.assertEqual(output, "<Main Title>other text")
|
||||
|
||||
@setup(
|
||||
{
|
||||
"template": (
|
||||
|
||||
Reference in New Issue
Block a user