Skip to content

Commit

Permalink
Confirm command does not send duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
sarayourfriend committed May 6, 2024
1 parent 089511d commit 85d4f95
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api/test/unit/management/commands/test_sendapimoveannouncement.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,18 @@ def test_should_not_send_to_unverified_emails(captured_emails):

call_cmd(dry_run=False)
assert len(captured_emails) == 0


@pytest.mark.django_db
def test_should_not_send_to_email_twice(captured_emails):
emails = make_emails(10, verified=True)
OAuth2VerificationFactory.create(
email=emails[0],
)

call_cmd(dry_run=False)
# Not 11
assert len(captured_emails) == 10

# Only appears once
assert len([email for email in emails if email == emails[0]]) == 1

0 comments on commit 85d4f95

Please sign in to comment.