MCPcopy Create free account
hub / github.com/pallets/quart / test_default_template_context

Function test_default_template_context

tests/test_templating.py:42–52  ·  view source on GitHub ↗
(app: Quart)

Source from the content-addressed store, hash-verified

40
41
42async def test_default_template_context(app: Quart) -> None:
43 async with app.app_context():
44 g.foo = "bar"
45 rendered = await render_template_string("{{ g.foo }}")
46 assert rendered == "bar"
47 async with app.test_request_context("/"):
48 session["foo"] = "bar"
49 rendered = await render_template_string(
50 "{{ request.method }} {{ request.path }} {{ session.foo }}"
51 )
52 assert rendered == "GET / bar"
53
54
55async def test_template_context_processors(app: Quart, blueprint: Blueprint) -> None:

Callers

nothing calls this directly

Calls 3

render_template_stringFunction · 0.90
app_contextMethod · 0.80
test_request_contextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…