-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure that there is a to address in the message
The first one in the list of recipients is the to address. The rest of recipients are sent as Bcc
- Loading branch information
Showing
2 changed files
with
22 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -377,7 +377,7 @@ def test_do_mail_if_entry_has_diff(self): | |
sendgrid_config = { | ||
"api_token": "12345", | ||
"sender": "[email protected]", | ||
"recipients": "[email protected], [email protected]", | ||
"recipients": "[email protected]", | ||
} | ||
result = process_entry(entry, {"sendgrid": sendgrid_config}, None, sendgrid) | ||
|
||
|
@@ -639,6 +639,26 @@ def test_raises_if_not_all_archive_urls_are_present(self): | |
"sendgrid.publish_diff raised AchiveUrlNotFoundError unexpectedly!" | ||
) | ||
|
||
def test_only_one_recipient(self): | ||
config = { | ||
"sendgrid": { | ||
"api_token": "12345", | ||
"sender": "[email protected]", | ||
"recipients": "[email protected]", | ||
} | ||
} | ||
|
||
sendgrid = SendgridHandler(config["sendgrid"]) | ||
|
||
diff = get_mocked_diff(False) | ||
type(diff.old).archive_url = PropertyMock(return_value="http://test.url/old") | ||
type(diff.new).archive_url = PropertyMock(return_value="http://test.url/new") | ||
|
||
try: | ||
sendgrid.publish_diff(diff, config["sendgrid"]) | ||
except Exception as e: | ||
self.fail(e) | ||
|
||
|
||
def get_mocked_diff(with_archive_urls=True): | ||
old = MagicMock() | ||
|