From d4c5d2b52c897ccc07f04482d3f42f976a79223c Mon Sep 17 00:00:00 2001 From: cheng Date: Wed, 13 Jul 2022 23:11:17 -0700 Subject: Fixed #33631 -- Marked {% blocktranslate asvar %} result as HTML safe. --- .../syntax_tests/i18n/test_blocktranslate.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/template_tests/syntax_tests/i18n/test_blocktranslate.py') diff --git a/tests/template_tests/syntax_tests/i18n/test_blocktranslate.py b/tests/template_tests/syntax_tests/i18n/test_blocktranslate.py index 4a162362c6..4c9036ba76 100644 --- a/tests/template_tests/syntax_tests/i18n/test_blocktranslate.py +++ b/tests/template_tests/syntax_tests/i18n/test_blocktranslate.py @@ -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": "
"} + output = self.engine.render_to_string("i18n_asvar_safestring", context=context) + self.assertEqual(output, "<Main Title>other text") + @setup( { "template": ( -- cgit v1.3