From 3b074f00d8aa8a064b8c5bee58e2ac006263a9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Mon, 27 Jul 2026 01:55:36 +0400 Subject: [PATCH] test(e2e): configure CSRF_SECRET for E2E tests --- tests/e2e/conftest.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index 59dc1df..22a0057 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -71,6 +71,20 @@ def base_url(): port = _trouver_port() url = f"http://{SERVER_HOST}:{port}" + # Les tokens CSRF stateless sont signés avec CSRF_SECRET. Sans configuration + # locale, getCsrfSecret() génère un secret éphémère par processus, ce qui + # rend les tokens invalides d'une requête à l'autre sous `php -S`. + # On crée donc une configuration locale temporaire avec un secret fixe. + config_local = PROJECT_ROOT / "includes" / "config.local.php" + config_local_exists = config_local.exists() + if not config_local_exists: + config_local.write_text( + "