Skip to content

Commit

Permalink
ISSUE-1902 Test
Browse files Browse the repository at this point in the history
  • Loading branch information
rwielk committed Oct 25, 2023
1 parent 45d41d4 commit e883598
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@


class TestCorner:
def test_uptodate_loader(self, env):
class UpToDateDictLoader(DictLoader):
def get_source(self, environment: "Environment", template: str):
contents, path, uptodate = super().get_source(environment, template)
return contents, path, True

env = Environment(
loader=UpToDateDictLoader(
{
"a.html": """
{%- set foo = 'bar' -%}
{% include 'x.html' -%}{% include 'x.html' -%}
""",
"x.html": """{{ foo }}|{{ test }}""",
}
)
)

a = env.get_template("a.html")

assert a.render(test="x").strip() == "bar|xbar|x"

def test_assigned_scoping(self, env):
t = env.from_string(
"""
Expand Down

0 comments on commit e883598

Please sign in to comment.