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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user