diff --git a/ClientAdvisor/App/app.py b/ClientAdvisor/App/app.py index e8221243..07790479 100644 --- a/ClientAdvisor/App/app.py +++ b/ClientAdvisor/App/app.py @@ -51,8 +51,9 @@ def create_app(): app = Quart(__name__) - app.register_blueprint(bp) + app.config["PROVIDE_AUTOMATIC_OPTIONS"] = True app.config["TEMPLATES_AUTO_RELOAD"] = True + app.register_blueprint(bp) # app.secret_key = secrets.token_hex(16) # app.session_interface = SecureCookieSessionInterface() return app diff --git a/ClientAdvisor/App/tests/test_app.py b/ClientAdvisor/App/tests/test_app.py index c0202a5b..1e2dffd4 100644 --- a/ClientAdvisor/App/tests/test_app.py +++ b/ClientAdvisor/App/tests/test_app.py @@ -42,7 +42,12 @@ def set_env_vars(): @pytest.fixture def flaskapp(): """Create a test client for the app.""" - return create_app() + app = create_app() + app.config.update({ + "TESTING": True, + "PROVIDE_AUTOMATIC_OPTIONS": True, # Ensure this is set in the test environment + }) + return app @pytest.fixture @@ -53,6 +58,10 @@ def client(flaskapp): def test_create_app(): app = create_app() + app.config.update({ + "TESTING": True, + "PROVIDE_AUTOMATIC_OPTIONS": True, # Ensure this is set in the test environment + }) assert app is not None assert app.name == "app" assert "routes" in app.blueprints