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

Function test_context_processing

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

Source from the content-addressed store, hash-verified

9
10
11def test_context_processing(app, client):
12 @app.context_processor
13 def context_processor():
14 return {"injected_value": 42}
15
16 @app.route("/")
17 def index():
18 return flask.render_template("context_template.html", value=23)
19
20 rv = client.get("/")
21 assert rv.data == b"<p>23|42"
22
23
24def test_original_win(app, client):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected