def app(): # load 'TestConfig' from config.py app = create_app(config_name='test') from api.extensions import db with app.app_context(): db.create_all() yield app db.drop_all()
def db(app): _db.app = app with app.app_context(): _db.create_all() yield _db _db.session.close() _db.drop_all()
def dropall(): "Drops all database tables" if prompt_bool("Are you sure ? You will lose all your data !"): db.drop_all()
def tearDownClass(self): with FLASKR.app_context(): db.drop_all() pass
def teardown_db(): db.session.remove() db.drop_all() db.session.bind.dispose()
def tearDown(self): db.session.remove() db.drop_all()