-
Notifications
You must be signed in to change notification settings - Fork 18
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 #763 from Crown-Commercial-Service/handle-removed-…
…email Handle removed email race condition
- Loading branch information
Showing
3 changed files
with
29 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
from .flask_init import init_app | ||
|
||
|
||
__version__ = '60.7.1' | ||
__version__ = '60.8.0' |
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 |
---|---|---|
|
@@ -603,3 +603,27 @@ def test_permanently_remove_email_from_list_failure(self, exception): | |
subscriber_hash="ee5ae5f54bdf3394d48ea4e79e6d0e39", | ||
), | ||
] | ||
|
||
def test_permanently_remove_email_from_list_already_removed(self): | ||
dm_mailchimp_client = DMMailChimpClient('username', DUMMY_MAILCHIMP_API_KEY, logging.getLogger('mailchimp')) | ||
with mock.patch.object( | ||
dm_mailchimp_client._client.lists.members, | ||
'delete_permanent', | ||
autospec=True, | ||
) as del_perm: | ||
del_perm.side_effect = MailChimpError({"status": 404}) | ||
|
||
with assert_external_service_log_entry(successful_call=False, extra_modules=['mailchimp'], count=1): | ||
result = dm_mailchimp_client.permanently_remove_email_from_list( | ||
"[email protected]", | ||
"modern_society", | ||
) | ||
|
||
assert result is True | ||
|
||
assert del_perm.call_args_list == [ | ||
mock.call( | ||
list_id="modern_society", | ||
subscriber_hash="ee5ae5f54bdf3394d48ea4e79e6d0e39", | ||
), | ||
] |