aboutsummaryrefslogtreecommitdiff
path: root/tests/test_ext.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_ext.py')
-rw-r--r--tests/test_ext.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_ext.py b/tests/test_ext.py
index a870d5b5..9a5bdfd6 100644
--- a/tests/test_ext.py
+++ b/tests/test_ext.py
@@ -355,6 +355,14 @@ class TestNewstyleInternationalization():
assert t.render(ae=True) == '<strong>Wert: &lt;test&gt;</strong>'
assert t.render(ae=False) == '<strong>Wert: <test></strong>'
+ def test_autoescape_macros(self):
+ env = Environment(autoescape=False, extensions=['jinja2.ext.autoescape'])
+ template = (
+ '{% macro m() %}<html>{% endmacro %}'
+ '{% autoescape true %}{{ m() }}{% endautoescape %}'
+ )
+ assert env.from_string(template).render() == '<html>'
+
def test_num_used_twice(self):
tmpl = newstyle_i18n_env.get_template('ngettext_long.html')
assert tmpl.render(apples=5, LANGUAGE='de') == u'5 Äpfel'