From f5004ebce87f5f6311a884ba58543eee2d0e2f5e Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sun, 28 Aug 2022 15:56:58 +0200 Subject: [PATCH] Add test_with_trailing_comma - to test support for trailing commas in with statements --- tests/test_core_tags.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_core_tags.py b/tests/test_core_tags.py index 71e8733c2..b3602ddb6 100644 --- a/tests/test_core_tags.py +++ b/tests/test_core_tags.py @@ -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"