From dba8669f4b8d4b33d3a91bb42f742220adcc45bf Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Wed, 24 Jun 2026 22:16:02 +0200 Subject: [PATCH] =?UTF-8?q?test(compte):=20redirections=20d'acc=C3=A8s=20d?= =?UTF-8?q?e=20l'espace=20compte=20(#73)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- tests/test_compte_pages.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/test_compte_pages.py diff --git a/tests/test_compte_pages.py b/tests/test_compte_pages.py new file mode 100644 index 0000000..62ba816 --- /dev/null +++ b/tests/test_compte_pages.py @@ -0,0 +1,19 @@ +from dash.testing.composite import DashComposite + + +def test_compte_redirects_anonymous_to_login(dash_duo: DashComposite): + from src.app import app + + dash_duo.start_server(app) + dash_duo.driver.get(dash_duo.server_url + "/compte/admin") + dash_duo.wait_for_text_to_equal("h2", "Connexion", timeout=8) + assert "/connexion" in dash_duo.driver.current_url + + +def test_compte_root_redirects_to_admin(dash_duo: DashComposite): + from src.app import app + + dash_duo.start_server(app) + dash_duo.driver.get(dash_duo.server_url + "/compte") + # /compte (anonyme) → /compte/admin → /connexion + dash_duo.wait_for_text_to_equal("h2", "Connexion", timeout=8)