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

Method test_extends_output_bugs

tests/test_regression.py:93–104  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

91 )
92
93 def test_extends_output_bugs(self, env):
94 env = Environment(
95 loader=DictLoader({"parent.html": "(({% block title %}{% endblock %}))"})
96 )
97
98 t = env.from_string(
99 '{% if expr %}{% extends "parent.html" %}{% endif %}'
100 "[[{% block title %}title{% endblock %}]]"
101 "{% for item in [1, 2, 3] %}({{ item }}){% endfor %}"
102 )
103 assert t.render(expr=False) == "[[title]](1)(2)(3)"
104 assert t.render(expr=True) == "((title))"
105
106 def test_urlize_filter_escaping(self, env):
107 tmpl = env.from_string('{{ "http://www.example.org/<foo"|urlize }}')

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