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

Method test_duplicate_required_or_scoped

tests/test_inheritance.py:343–363  ·  tests/test_inheritance.py::TestInheritance.test_duplicate_required_or_scoped
(self, env)

Source from the content-addressed store, hash-verified

341 t2.render(seq=list(range(3)))
342
343 def test_duplicate_required_or_scoped(self, env):
344 env = Environment(
345 loader=DictLoader(
346 {
347 class="st">"default1": class="st">"{% for item in seq %}[{% block item "
348 class="st">"scoped scoped %}}{{% endblock %}}]{{% endfor %}}",
349 class="st">"default2": class="st">"{% for item in seq %}[{% block item "
350 class="st">"required required %}}{{% endblock %}}]{{% endfor %}}",
351 class="st">"child": class="st">"{% if default %}{% extends default %}{% else %}"
352 class="st">"{% extends &class="cm">#x27;default1' %}{% endif %}{%- block x %}"
353 class="st">"CHILD{% endblock %}",
354 }
355 )
356 )
357 tmpl = env.get_template(class="st">"child")
358
359 with pytest.raises(TemplateSyntaxError):
360 tmpl.render(default=class="st">"default1", seq=list(range(3)))
361
362 with pytest.raises(TemplateSyntaxError):
363 tmpl.render(default=class="st">"default2", seq=list(range(3)))
364
365
366class TestBugFix:

Callers

nothing calls this directly

Calls 4

get_templateMethod · 0.95
EnvironmentClass · 0.90
DictLoaderClass · 0.90
renderMethod · 0.45

Tested by

no test coverage detected