MCPcopy
hub / github.com/pallets/jinja / test_unoptimized_scopes_autoescape

Method test_unoptimized_scopes_autoescape

tests/test_async.py:287–304  ·  tests/test_async.py::TestAsyncIncludes.test_unoptimized_scopes_autoescape
(self)

Source from the content-addressed store, hash-verified

285 assert t.render().strip() == class="st">"(FOO)"
286
287 def test_unoptimized_scopes_autoescape(self):
288 env = Environment(
289 loader=DictLoader({class="st">"o_printer": class="st">"({{ o }})"}),
290 autoescape=True,
291 enable_async=True,
292 )
293 t = env.from_string(
294 class="st">"""
295 {% macro outer(o) %}
296 {% macro inner() %}
297 {% include class="st">"o_printer" %}
298 {% endmacro %}
299 {{ inner() }}
300 {% endmacro %}
301 {{ outer(class="st">"FOO") }}
302 class="st">"""
303 )
304 assert t.render().strip() == class="st">"(FOO)"
305
306
307class TestAsyncForLoop:

Callers

nothing calls this directly

Calls 4

from_stringMethod · 0.95
EnvironmentClass · 0.90
DictLoaderClass · 0.90
renderMethod · 0.45

Tested by

no test coverage detected