Clarified how to test with click

This commit is contained in:
Armin Ronacher 2014-05-02 11:50:00 +01:00
parent d2d8e66130
commit b9013ede22
2 changed files with 12 additions and 4 deletions

View file

@ -43,7 +43,8 @@ In order to test the application, we add a second module
self.db_fd, flaskr.app.config['DATABASE'] = tempfile.mkstemp()
flaskr.app.config['TESTING'] = True
self.app = flaskr.app.test_client()
flaskr.init_db()
with flaskr.app.app_context():
flaskr.init_db()
def tearDown(self):
os.close(self.db_fd)