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

@ -20,7 +20,8 @@ class MiniTwitTestCase(unittest.TestCase):
"""Before each test, set up a blank database"""
self.db_fd, minitwit.app.config['DATABASE'] = tempfile.mkstemp()
self.app = minitwit.app.test_client()
minitwit.init_db()
with minitwit.app.app_context():
minitwit.init_db()
def tearDown(self):
"""Get rid of the database again after each test."""