rewrite testing docs

This commit is contained in:
David Lord 2022-02-13 13:57:33 -08:00
parent d6496c8e29
commit 761d7e1652
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
2 changed files with 283 additions and 427 deletions

View file

@ -168,9 +168,9 @@ thing, like it does for :class:`request` and :class:`session`.
:attr:`Flask.app_ctx_globals_class`, which defaults to
:class:`ctx._AppCtxGlobals`.
This is a good place to store resources during a request. During
testing, you can use the :ref:`faking-resources` pattern to
pre-configure such resources.
This is a good place to store resources during a request. For
example, a ``before_request`` function could load a user object from
a session id, then set ``g.user`` to be used in the view function.
This is a proxy. See :ref:`notes-on-proxies` for more information.