Skip to content
Myr

fix docs ref

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent d318b68 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/flask/app.py+2 added-2 removed
1503 unmodified lines
1504 def request_context(self, environ: WSGIEnvironment) -> AppContext:1505 """Create an :class:`.AppContext` with request information representing1506 the given WSGI environment. A context is automatically pushed when1507 handling each request. When the context is pushed, :data:`.request`,1508 :data:`.session`, :data:`g:, and :data:`.current_app` become available.1508 :data:`.session`, :data:`g`, and :data:`.current_app` become available.15091510 This method should not be used in your own code. Creating a valid WSGI1511 environ is not trivial. Use :meth:`test_request_context` to correctly1512 create a WSGI environ and request context instead.
6 unmodified lines
15191520 def test_request_context(self, *args: t.Any, **kwargs: t.Any) -> AppContext:1521 """Create an :class:`.AppContext` with request information created from1522 the given arguments. When the context is pushed, :data:`.request`,1523 :data:`.session`, :data:`g:, and :data:`.current_app` become available.1523 :data:`.session`, :data:`g`, and :data:`.current_app` become available.15241525 This is useful during testing to run a function that uses request data1526 without dispatching a full request. Use this as a ``with`` block to push1527 a context.
101 unmodified lines