Skip to content
Myr

Add import flask module required to run code on Other Testing Tricks

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

authored by Winston Kouch · committed by Winston Kouch · parent ec5811d · Browse files · 1 file+2 added−0 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−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:docs/testing.rst+2 added
205 unmodified lines
206temporarily. With this you can access the :class:`~flask.request`,207:class:`~flask.g` and :class:`~flask.session` objects like in view208functions. Here is a full example that demonstrates this approach::209210 import flask211 212 app = flask.Flask(__name__)213214 with app.test_request_context('/?name=Peter'):215 assert flask.request.path == '/'
140 unmodified lines