From 8a1cd3c0041d580b9e9b70fe17be9c0c68c38d3f Mon Sep 17 00:00:00 2001 From: Vincent Porte Date: Wed, 4 Dec 2024 22:35:25 +0100 Subject: [PATCH] refactor: correction d'un test fragile (#848) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description 🎸 `TestSendMagicLink` ## Type de changement 🚧 technique ### Points d'attention 🦺 forcer le token à `fixed-token` pour tester son affichage --- lacommunaute/users/tests/tests_views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lacommunaute/users/tests/tests_views.py b/lacommunaute/users/tests/tests_views.py index e3f19f4c..134331b6 100644 --- a/lacommunaute/users/tests/tests_views.py +++ b/lacommunaute/users/tests/tests_views.py @@ -86,7 +86,9 @@ def validate_magiclink_payload(payload_as_str, uidb64, token, expected): class TestSendMagicLink: @pytest.mark.parametrize("env,count_msg", [(Environment.PROD, 0), (Environment.DEV, 1)]) - def test_send_magic_link(self, db, user, snapshot, mock_respx_post_to_sib_smtp_url, env, count_msg): + def test_send_magic_link( + self, db, user, snapshot, mock_token_generator, mock_respx_post_to_sib_smtp_url, env, count_msg + ): with override_settings(ENVIRONMENT=env): next_url = "/topics/" request = RequestFactory().get("/")