Skip to content

Commit

Permalink
refactor: correction d'un test fragile (#848)
Browse files Browse the repository at this point in the history
## Description

🎸 `TestSendMagicLink`

## Type de changement

🚧 technique

### Points d'attention

🦺 forcer le token à `fixed-token` pour tester son affichage
  • Loading branch information
vincentporte authored Dec 4, 2024
1 parent 4491d8d commit 8a1cd3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lacommunaute/users/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("/")
Expand Down

0 comments on commit 8a1cd3c

Please sign in to comment.