summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests/i18n/test_blocktranslate.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests/syntax_tests/i18n/test_blocktranslate.py')
-rw-r--r--tests/template_tests/syntax_tests/i18n/test_blocktranslate.py16
1 files changed, 16 insertions, 0 deletions
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
@@ -418,6 +418,22 @@ class I18nBlockTransTagTests(SimpleTestCase):
@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, "&lt;Main Title&gt;other text")
+
+ @setup(
+ {
"template": (
"{% load i18n %}{% blocktranslate asvar %}Yes{% endblocktranslate %}"
)