Skip to content

Commit 07b618a

Browse files
author
Sébastien Granjoux
committed
Check nested list comprehension with strict_undefined
1 parent e6915e3 commit 07b618a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/test_template.py

+13
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,19 @@ def foo():
916916

917917
eq_(result_lines(t.render()), ["foo"])
918918

919+
def test_nested_list_comprehensions_in_function_plus_undeclared_strict(
920+
self,
921+
):
922+
t = Template(
923+
"""
924+
<%foo = lambda b : sum(f for s in b for f in s)%>\
925+
${ foo(([1,2],[3,4]))}
926+
""",
927+
strict_undefined=True,
928+
)
929+
930+
eq_(result_lines(t.render()), ["10"])
931+
919932

920933
class StopRenderingTest(TemplateTest):
921934
def test_return_in_template(self):

0 commit comments

Comments
 (0)