diff options
author | Martin Krizek <martin.krizek@gmail.com> | 2021-10-13 16:56:48 +0200 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2021-11-10 11:17:33 -0800 |
commit | 2903565262e6c8971e612a2717feb430e284e4ac (patch) | |
tree | 9afc5d16acee5c2802df206c56e62849960869ad /tests | |
parent | b285d0c2e65f546d340b7cac75dbb9f74267bc23 (diff) | |
download | jinja2-2903565262e6c8971e612a2717feb430e284e4ac.tar.gz |
support native types in macros
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_nativetypes.py | 7 |
1 files changed, 7 insertions, 0 deletions
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) |