Skip to content

Commit

Permalink
feat: add a test case to ensure local vars are forwarded in context
Browse files Browse the repository at this point in the history
  • Loading branch information
CNSeniorious000 committed Oct 9, 2024
1 parent 7945278 commit 1880ad2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/tests/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,10 @@ def test_components_context():
assert Template("{% a b=1, c=2 %}").render({"a": Template("{{ b }}{{ c }}{{ d }}"), "d": 3}) == "123"


def test_components_in_for_loop():
assert Template("{% for i in '123' %}{% a %}{% endfor %}").render({"a": Template("{{ i }}")}) == "123"


def test_else_tag_in_for_loop():
render_assert("{% for i in '123' %}{{ i }}{% else %}4{% endfor %}", None, "1234")

Expand Down

0 comments on commit 1880ad2

Please sign in to comment.