From: Armin Ronacher Date: Tue, 3 Jan 2017 01:30:05 +0000 (+0100) Subject: Added a second test for #278 X-Git-Tag: 2.9~30^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fc73b16c01afd67e1b10a50642f16576eb8305a;p=thirdparty%2Fjinja.git Added a second test for #278 --- diff --git a/tests/test_regression.py b/tests/test_regression.py index 1ba936b8..6a0b2686 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -306,3 +306,14 @@ class TestBug(): {% endmacro %}{{ test() }} ''') assert tmpl.render().strip() == '0123456789' + + def test_macro_var_bug_advanced(self, env): + tmpl = env.from_string(''' + {% macro outer() %} + {% set i = 1 %} + {% macro test() %} + {% for i in range(0, 10) %}{{ i }}{% endfor %} + {% endmacro %}{{ test() }} + {% endmacro %}{{ outer() }} + ''') + assert tmpl.render().strip() == '0123456789'