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

Method test_block_set_with_extends

tests/test_regression.py:313–318  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

311 assert output == expected
312
313 def test_block_set_with_extends(self):
314 env = Environment(
315 loader=DictLoader({"main": "{% block body %}[{{ x }}]{% endblock %}"})
316 )
317 t = env.from_string('{% extends "main" %}{% set x %}42{% endset %}')
318 assert t.render() == "[42]"
319
320 def test_nested_for_else(self, env):
321 tmpl = env.from_string(

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