refactor(brevo): utiliser DEVELOPMENT pour le mode sandbox Brevo (#87)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Colin Maudry
2026-06-24 15:40:46 +02:00
parent c0927c718d
commit c3408ecc3c
4 changed files with 3 additions and 7 deletions
-1
View File
@@ -50,7 +50,6 @@ def test_send_reset_email(fake_client):
def test_init_mailer_builds_client(monkeypatch):
monkeypatch.setenv("BREVO_API_KEY", "test-key")
monkeypatch.delenv("BREVO_SANDBOX", raising=False)
monkeypatch.setattr(mailer, "_client", None)
mailer.init_mailer()
assert mailer._client is not None
+1 -2
View File
@@ -12,8 +12,7 @@ pytestmark = pytest.mark.integration
reason="BREVO_API_KEY absent — test d'intégration Brevo ignoré",
)
def test_send_verification_email_sandbox(monkeypatch):
# Force le mode sandbox : Brevo valide la requête sans délivrer.
monkeypatch.setenv("BREVO_SANDBOX", "true")
# DEVELOPMENT=true (défini dans pytest.ini_options) active le mode sandbox Brevo.
monkeypatch.setenv("APP_BASE_URL", "http://localhost:8050")
mailer.init_mailer()
# Ne doit pas lever : l'API Brevo accepte la requête en sandbox.