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

Method test_super

tests/test_inheritance.py:109–124  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

107 )
108
109 def test_super(self, env):
110 env = Environment(
111 loader=DictLoader(
112 {
113 "a": "{% block intro %}INTRO{% endblock %}|"
114 "BEFORE|{% block data %}INNER{% endblock %}|AFTER",
115 "b": '{% extends "a" %}{% block data %}({{ '
116 "super() }}){% endblock %}",
117 "c": '{% extends "b" %}{% block intro %}--{{ '
118 "super() }}--{% endblock %}\n{% block data "
119 "%}[{{ super() }}]{% endblock %}",
120 }
121 )
122 )
123 tmpl = env.get_template("c")
124 assert tmpl.render() == "--INTRO--|BEFORE|[(INNER)]|AFTER"
125
126 def test_working(self, env):
127 env.get_template("working")

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