def drop_db(): """Initialize database""" from factory import db, app app = create_app('default') app_context = app.app_context() app_context.push() db.drop_all() app_context.pop()
def tearDown(self): db.session.remove() db.drop_all() self.app_context.pop()