def flask_app(): """ Create base flask application for testing. """ app = create_app('testing') app.app_context().push() DB.drop_all(app=app) DB.create_all(app=app) return app
def flask_app_user_in_db(): """ Create flask application for testing with a user in the DB. """ app = create_app('testing') DB.drop_all(app=app) DB.create_all(app=app) app.app_context().push() user_id = {'user_id': "1"} schema = UserSchema().load(user_id) new_user = UserModel(**schema.data) DB.session.begin() DB.session.add(new_user) DB.session.commit() return app