Fixed flask tests

This commit is contained in:
Armin Ronacher 2014-05-02 11:46:04 +01:00
parent e059bf311c
commit d2d8e66130
5 changed files with 23 additions and 10 deletions

View file

@ -21,7 +21,8 @@ class FlaskrTestCase(unittest.TestCase):
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):
"""Get rid of the database again after each test."""