def app(): params = { "DEBUG": False, "TESTING": True, 'WTF_CSRF_ENABLED': False, } _app = create_app(settings_override=params) ctx = _app.app_context() ctx.push() yield _app ctx.pop()
def app(): """ Setup our flask test app, this only gets executed once. :return: Flask app """ db_uri = '{0}_test'.format(settings.SQLALCHEMY_DATABASE_URI) params = { 'DEBUG': False, 'TESTING': True, 'WTF_CSRF_ENABLED': False, 'SQLALCHEMY_DATABASE_URI': db_uri } _app = create_app(settings_override=params) # Establish an application context before running the tests. ctx = _app.app_context() ctx.push() yield _app ctx.pop()
from hms.app import create_app app = create_app() if __name__ == '__main__': app.run(debug=True)