Skip to content
Prev Previous commit
Next Next commit
Add test_with_trailing_comma
- to test support for trailing commas in with statements
  • Loading branch information
Zocker1999NET committed Aug 28, 2022
commit 7d1c34e109426d4360d4ff37046c1f53e741e2a8
9 changes: 9 additions & 0 deletions tests/test_core_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,3 +617,12 @@ def test_with_argument_scoping(self, env):
"""
)
assert tmpl.render(b=3, e=4) == "1|2|3|4|5"

def test_with_trailing_comma(self, env):
tmpl = env.from_string(
"""\
{% with a=42, b=23, -%}
{{ a }} = {{ b }}
{% endwith -%}"""
)
assert tmpl.render().strip() == "42 = 23"