Home / Function/ test_template_rendered() — flask Function Reference

test_template_rendered() — flask Function Reference

Architecture documentation for the test_template_rendered() function in test_signals.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  a23540c4_f2be_d6a9_641d_c29fafb493b0["test_template_rendered()"]
  a3094b63_9b33_613c_f8a0_440ab19800e5["test_signals.py"]
  a23540c4_f2be_d6a9_641d_c29fafb493b0 -->|defined in| a3094b63_9b33_613c_f8a0_440ab19800e5
  style a23540c4_f2be_d6a9_641d_c29fafb493b0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_signals.py lines 4–22

def test_template_rendered(app, client):
    @app.route("/")
    def index():
        return flask.render_template("simple_template.html", whiskey=42)

    recorded = []

    def record(sender, template, context):
        recorded.append((template, context))

    flask.template_rendered.connect(record, app)
    try:
        client.get("/")
        assert len(recorded) == 1
        template, context = recorded[0]
        assert template.name == "simple_template.html"
        assert context["whiskey"] == 42
    finally:
        flask.template_rendered.disconnect(record, app)

Subdomains

Frequently Asked Questions

What does test_template_rendered() do?
test_template_rendered() is a function in the flask codebase, defined in tests/test_signals.py.
Where is test_template_rendered() defined?
test_template_rendered() is defined in tests/test_signals.py at line 4.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free