Skip to content

Commit

Permalink
Add a test for emails in different cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmenezes0 committed Aug 13, 2024
1 parent dcb54d8 commit dc82989
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/unit/test_emails.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
from django.core import mail
import pytest

from consultation_analyser.email import send_magic_link_email


def test_magic_link_email():
@pytest.mark.parametrize("email", [("[email protected]",), ("[email protected]",)])
def test_magic_link_email(email):
send_magic_link_email(
to="email@example.com",
to=email,
magic_link="https://example.com",
)

sent_mail = mail.outbox[0]
assert sent_mail.subject == "Sign in to Consult"
assert ["email@example.com"] == sent_mail.to
assert [email] == sent_mail.to
assert "https://example.com" in sent_mail.body

0 comments on commit dc82989

Please sign in to comment.