From 8896726e09aaf87fae73679d20806c3ce1964ae9 Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Mon, 20 Apr 2026 17:34:12 +0200 Subject: [PATCH] =?UTF-8?q?src/app.py=20:=20initialisation=20de=20l'authen?= =?UTF-8?q?tification=20au=20d=C3=A9marrage=20(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- src/app.py | 3 +++ tests/auth/test_app_integration.py | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/auth/test_app_integration.py diff --git a/src/app.py b/src/app.py index d5ddb6f..1818d95 100644 --- a/src/app.py +++ b/src/app.py @@ -7,6 +7,7 @@ from dash import Dash, Input, Output, State, dcc, html, page_container, page_reg from dotenv import load_dotenv from flask import Response +from src.auth.setup import init_auth from src.utils import DEVELOPMENT from src.utils.cache import cache @@ -50,6 +51,8 @@ cache.init_app( }, ) +init_auth(app.server) + # robots.txt @app.server.route("/robots.txt") diff --git a/tests/auth/test_app_integration.py b/tests/auth/test_app_integration.py new file mode 100644 index 0000000..aa736e7 --- /dev/null +++ b/tests/auth/test_app_integration.py @@ -0,0 +1,8 @@ +def test_app_imports_cleanly(users_db_path): + from src.app import app + + assert app is not None + # Flask-Login manager attaché + assert "login_manager" in app.server.extensions or hasattr( + app.server, "login_manager" + )