mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Show separate error messages for team key
Although using a team key is functionally the same as your service being restricted, conflating the two errors is not helpful. What we typically saw in research was that someone was using a team key, got the error, used a live key and got the _same_ error. This commit adds a new error message that specifically mentions the type of API key that you’re using.
This commit is contained in:
@@ -704,10 +704,9 @@ def test_should_not_send_email_if_team_api_key_and_not_a_service_user(notify_api
|
||||
app.celery.tasks.send_email.apply_async.assert_not_called()
|
||||
|
||||
assert response.status_code == 400
|
||||
assert [(
|
||||
'Can’t send to this recipient when service is in trial mode – see '
|
||||
'https://www.notifications.service.gov.uk/trial-mode'
|
||||
)] == json_resp['message']['to']
|
||||
assert [
|
||||
'Can’t send to this recipient using a team-only API key'
|
||||
] == json_resp['message']['to']
|
||||
|
||||
|
||||
def test_should_not_send_sms_if_team_api_key_and_not_a_service_user(notify_api, sample_template, mocker):
|
||||
@@ -730,10 +729,9 @@ def test_should_not_send_sms_if_team_api_key_and_not_a_service_user(notify_api,
|
||||
app.celery.tasks.send_sms.apply_async.assert_not_called()
|
||||
|
||||
assert response.status_code == 400
|
||||
assert [(
|
||||
'Can’t send to this recipient when service is in trial mode – see '
|
||||
'https://www.notifications.service.gov.uk/trial-mode'
|
||||
)] == json_resp['message']['to']
|
||||
assert [
|
||||
'Can’t send to this recipient using a team-only API key'
|
||||
] == json_resp['message']['to']
|
||||
|
||||
|
||||
def test_should_send_email_if_team_api_key_and_a_service_user(notify_api, sample_email_template, mocker):
|
||||
|
||||
Reference in New Issue
Block a user