diff --git a/pyproject.toml b/pyproject.toml index 1b5c028..3575dd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,7 @@ env = [ "USERS_DB_PATH=tests/users.test.sqlite", "SECRET_KEY=test-secret-do-not-use-in-prod", "MAIL_FROM=test@decp.info", + "MAIL_SUPPRESS_SEND=true", "APP_BASE_URL=http://localhost:8050", "SMTP_HOST=localhost", "SMTP_PORT=25", diff --git a/src/auth/mailer.py b/src/auth/mailer.py index c5fc0e0..dce0f57 100644 --- a/src/auth/mailer.py +++ b/src/auth/mailer.py @@ -66,7 +66,7 @@ def _send( def send_verification_email(email: str, token: str) -> None: - link = f"{_base_url()}/verification-email?token={token}" + link = f"{_base_url()}/auth/verify-email?token={token}" _send( "Vérification de votre adresse email — decp.info", email, diff --git a/tests/auth/test_mailer.py b/tests/auth/test_mailer.py index 37a74a3..75ac897 100644 --- a/tests/auth/test_mailer.py +++ b/tests/auth/test_mailer.py @@ -29,8 +29,8 @@ def test_send_verification_email(mail_app): assert len(outbox) == 1 msg = outbox[0] assert msg.recipients == ["a@b.c"] - assert "verification-email?token=TOKEN123" in msg.body - assert "verification-email?token=TOKEN123" in msg.html + assert "/auth/verify-email?token=TOKEN123" in msg.body + assert "/auth/verify-email?token=TOKEN123" in msg.html def test_send_reset_email(mail_app):