From 2903565262e6c8971e612a2717feb430e284e4ac Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Wed, 13 Oct 2021 16:56:48 +0200 Subject: support native types in macros --- tests/test_nativetypes.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/test_nativetypes.py b/tests/test_nativetypes.py index 9bae938..8c85252 100644 --- a/tests/test_nativetypes.py +++ b/tests/test_nativetypes.py @@ -153,3 +153,10 @@ def test_leading_spaces(env): t = env.from_string(" {{ True }}") result = t.render() assert result == " True" + + +def test_macro(env): + t = env.from_string("{%- macro x() -%}{{- [1,2] -}}{%- endmacro -%}{{- x()[1] -}}") + result = t.render() + assert result == 2 + assert isinstance(result, int) -- cgit v1.2.1