|
|
@ -33,7 +33,7 @@ In order to test the application, we add a second module |
|
|
|
(:file:`flaskr_tests.py`) and create a unittest skeleton there:: |
|
|
|
(:file:`flaskr_tests.py`) and create a unittest skeleton there:: |
|
|
|
|
|
|
|
|
|
|
|
import os |
|
|
|
import os |
|
|
|
import flaskr |
|
|
|
from flaskr import flaskr |
|
|
|
import unittest |
|
|
|
import unittest |
|
|
|
import tempfile |
|
|
|
import tempfile |
|
|
|
|
|
|
|
|
|
|
@ -208,7 +208,7 @@ temporarily. With this you can access the :class:`~flask.request`, |
|
|
|
functions. Here is a full example that demonstrates this approach:: |
|
|
|
functions. Here is a full example that demonstrates this approach:: |
|
|
|
|
|
|
|
|
|
|
|
import flask |
|
|
|
import flask |
|
|
|
|
|
|
|
|
|
|
|
app = flask.Flask(__name__) |
|
|
|
app = flask.Flask(__name__) |
|
|
|
|
|
|
|
|
|
|
|
with app.test_request_context('/?name=Peter'): |
|
|
|
with app.test_request_context('/?name=Peter'): |
|
|
|