-
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.
Merge pull request #81 from andresfib/master
Added documentation and better support for multiple mail addresses
- Loading branch information
Showing
4 changed files
with
65 additions
and
15 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 |
---|---|---|
|
@@ -377,7 +377,7 @@ def test_do_mail_if_entry_has_diff(self): | |
sendgrid_config = { | ||
"api_token": "12345", | ||
"sender": "[email protected]", | ||
"receivers": "[email protected]", | ||
"recipients": "[email protected]", | ||
} | ||
result = process_entry(entry, {"sendgrid": sendgrid_config}, None, sendgrid) | ||
|
||
|
@@ -582,7 +582,7 @@ class SendgridHandlerTest(TestCase): | |
"sendgrid": { | ||
"api_token": "12345", | ||
"sender": "[email protected]", | ||
"receivers": "[email protected]", | ||
"recipients": "test@test.test, test2@test.test", | ||
} | ||
} | ||
|
||
|
@@ -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() | ||
|