def db(): with app.app_context(): from server.db import db db.session.close() db.drop_all() db.create_all() yield db
def create_db(): db.drop_all() db.create_all() db.session.commit()
def tearDown(self): """ Deletes created tables and closes the session instance """ db.session.remove() db.drop_all(app=app)
def drop_db(): db.drop_all()