MCPcopy
hub / github.com/pallets/flask / test_custom_app_ctx_globals_class

Function test_custom_app_ctx_globals_class

tests/test_appctx.py:157–164  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

155
156
157def test_custom_app_ctx_globals_class(app):
158 class CustomRequestGlobals:
159 def __init__(self):
160 self.spam = "eggs"
161
162 app.app_ctx_globals_class = CustomRequestGlobals
163 with app.app_context():
164 assert flask.render_template_string("{{ g.spam }}") == "eggs"
165
166
167def test_context_refcounts(app, client):

Callers

nothing calls this directly

Calls 1

app_contextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…