-
-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve the flags when creating the user from the partner and do not…
… deliver if user is pending deletion
- Loading branch information
Showing
6 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
from email.message import EmailMessage | ||
from typing import List | ||
|
||
import arrow | ||
import pytest | ||
from aiosmtpd.smtp import Envelope | ||
|
||
|
@@ -387,3 +388,15 @@ def test_preserve_headers(flask_client): | |
msg = sent_mails[0].msg | ||
for header in headers_to_keep: | ||
assert msg[header] == header + "keep" | ||
|
||
|
||
def test_not_send_to_pending_to_delete_users(flask_client): | ||
user = create_new_user() | ||
alias = Alias.create_new_random(user) | ||
user.delete_on = arrow.utcnow() | ||
envelope = Envelope() | ||
envelope.mail_from = "[email protected]" | ||
envelope.rcpt_tos = [alias.email] | ||
msg = EmailMessage() | ||
result = email_handler.handle(envelope, msg) | ||
assert result == status.E200 |