From: Armin Ronacher Date: Tue, 3 Jan 2017 01:33:59 +0000 (+0100) Subject: Checked in a failing test X-Git-Tag: 2.9~30^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ab69f24f9673062d0b9582777f04d4c2e9408a0;p=thirdparty%2Fjinja.git Checked in a failing test --- diff --git a/tests/test_regression.py b/tests/test_regression.py index 6a0b2686..066adbf6 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -317,3 +317,14 @@ class TestBug(): {% endmacro %}{{ outer() }} ''') assert tmpl.render().strip() == '0123456789' + + def test_callable_defaults(self): + env = Environment() + env.globals['get_int'] = lambda: 42 + t = env.from_string(''' + {% macro test(arg1=get_int()) %} + {{ arg1 }} + {% endmacro %} + {{ test(1) }}|{{ test() }} + ''') + assert t.render().strip() == '1|42'