-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix handling of additional monitoring email address (#1184)
- Loading branch information
1 parent
ab8d973
commit 096fad4
Showing
3 changed files
with
23 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -985,3 +985,19 @@ def test_send_profile_email(client, app): | |
assert len(outbox[0].recipients) == 4 | ||
assert '[email protected]' in outbox[0].recipients | ||
assert '[email protected]' in outbox[0].recipients | ||
|
||
|
||
def test_save_monitoring_email(client, app): | ||
test_login_succeeds_for_admin(client) | ||
m = app.data.find_one('monitoring', None, _id="5db11ec55f627d8aa0b545fb") | ||
m['email'] = 'axb.com, [email protected]' | ||
response = client.post('/monitoring/5db11ec55f627d8aa0b545fb', data=json.dumps(m), content_type='application/json') | ||
data = json.loads(response.get_data()) | ||
assert data['email'][0] == 'Invalid email address: axb.com' | ||
m['email'] = '[email protected] , [email protected]' | ||
response = client.post('/monitoring/5db11ec55f627d8aa0b545fb', data=json.dumps(m), content_type='application/json') | ||
data = json.loads(response.get_data()) | ||
assert data['success'] is True | ||
response = client.get('/monitoring/5db11ec55f627d8aa0b545fb') | ||
data = json.loads(response.get_data()) | ||
assert data['email'] == '[email protected],[email protected]' |