MCPcopy Create free account
hub / github.com/pallets/flask / test_standard_context

Function test_standard_context

tests/test_templating.py:53–68  ·  view source on GitHub ↗
(app, client)

Source from the content-addressed store, hash-verified

51
52
53def test_standard_context(app, client):
54 @app.route("/")
55 def index():
56 flask.g.foo = 23
57 flask.session["test"] = "aha"
58 return flask.render_template_string(
59 """
60 {{ request.args.foo }}
61 {{ g.foo }}
62 {{ config.DEBUG }}
63 {{ session.test }}
64 """
65 )
66
67 rv = client.get("/?foo=42")
68 assert rv.data.split() == [b"42", b"23", b"False", b"aha"]
69
70
71def test_escaping(app, client):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected