This repository has been archived by the owner on Jun 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose MessageId in Email backend (#24)
- Loading branch information
1 parent
b367423
commit 6b06136
Showing
4 changed files
with
14 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,19 @@ | |
@test("send email via ses") | ||
async def _(): | ||
with patch("pythonit_toolkit.emails.backends.ses.boto3") as mock_boto: | ||
SESEmailBackend("production").send_email( | ||
mock_boto.client.return_value.send_templated_email.return_value = { | ||
'MessageId': 'msg-id-123' | ||
} | ||
message_id = SESEmailBackend("production").send_email( | ||
template=EmailTemplate.RESET_PASSWORD, | ||
subject="Subject", | ||
from_="[email protected]", | ||
to="[email protected]", | ||
variables={"a": "b", "c": "d"}, | ||
) | ||
|
||
assert message_id == 'msg-id-123' | ||
|
||
mock_boto.client.return_value.send_templated_email.assert_called_once_with( | ||
Source="[email protected]", | ||
Destination={"ToAddresses": ["[email protected]"]}, | ||
|