Home / Function/ test_standard_context() — flask Function Reference

test_standard_context() — flask Function Reference

Architecture documentation for the test_standard_context() function in test_templating.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  a2a9e47f_31ba_3137_50f7_d4e8bbd7ed52["test_standard_context()"]
  b3595fee_7041_96b0_f59f_4080381c7deb["test_templating.py"]
  a2a9e47f_31ba_3137_50f7_d4e8bbd7ed52 -->|defined in| b3595fee_7041_96b0_f59f_4080381c7deb
  style a2a9e47f_31ba_3137_50f7_d4e8bbd7ed52 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_templating.py lines 53–68

def test_standard_context(app, client):
    @app.route("/")
    def index():
        flask.g.foo = 23
        flask.session["test"] = "aha"
        return flask.render_template_string(
            """
            {{ request.args.foo }}
            {{ g.foo }}
            {{ config.DEBUG }}
            {{ session.test }}
        """
        )

    rv = client.get("/?foo=42")
    assert rv.data.split() == [b"42", b"23", b"False", b"aha"]

Subdomains

Frequently Asked Questions

What does test_standard_context() do?
test_standard_context() is a function in the flask codebase, defined in tests/test_templating.py.
Where is test_standard_context() defined?
test_standard_context() is defined in tests/test_templating.py at line 53.

Analyze Your Own Codebase

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

Try Supermodel Free