test_before_render_template() — flask Function Reference
Architecture documentation for the test_before_render_template() function in test_signals.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD e5f5dac7_7690_dcb2_1ac0_afac298e40bb["test_before_render_template()"] a3094b63_9b33_613c_f8a0_440ab19800e5["test_signals.py"] e5f5dac7_7690_dcb2_1ac0_afac298e40bb -->|defined in| a3094b63_9b33_613c_f8a0_440ab19800e5 style e5f5dac7_7690_dcb2_1ac0_afac298e40bb fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_signals.py lines 25–47
def test_before_render_template():
app = flask.Flask(__name__)
@app.route("/")
def index():
return flask.render_template("simple_template.html", whiskey=42)
recorded = []
def record(sender, template, context):
context["whiskey"] = 43
recorded.append((template, context))
flask.before_render_template.connect(record, app)
try:
rv = app.test_client().get("/")
assert len(recorded) == 1
template, context = recorded[0]
assert template.name == "simple_template.html"
assert context["whiskey"] == 43
assert rv.data == b"<h1>43</h1>"
finally:
flask.before_render_template.disconnect(record, app)
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does test_before_render_template() do?
test_before_render_template() is a function in the flask codebase, defined in tests/test_signals.py.
Where is test_before_render_template() defined?
test_before_render_template() is defined in tests/test_signals.py at line 25.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free