Skip to content
Myr

Updated documentation for being able to use init_db method

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

authored by Sergio Díaz Sánchez · committed by Sergio Díaz Sánchez · parent dc5f48f · 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:docs/testing.rst+2 added-2 removed
31 unmodified lines
32In order to test the application, we add a second module33(:file:`flaskr_tests.py`) and create a unittest skeleton there::3435 import os36 import flaskr36 from flaskr import flaskr37 import unittest38 import tempfile3940 class FlaskrTestCase(unittest.TestCase):
166 unmodified lines
207:class:`~flask.g` and :class:`~flask.session` objects like in view208functions. Here is a full example that demonstrates this approach::209210 import flask211 211212 app = flask.Flask(__name__)213214 with app.test_request_context('/?name=Peter'):215 assert flask.request.path == '/'
140 unmodified lines