Check failure code on failure only.

We should check error code on failure only, because if we get an
error code on pending code, we should still set the notification
to pending status.
This commit is contained in:
Pea Tyczynska
2020-04-21 13:30:42 +01:00
parent 750a573afc
commit 9782cbc5b5
3 changed files with 21 additions and 4 deletions

View File

@@ -83,6 +83,19 @@ def test_process_sms_client_response_updates_notification_status_when_called_sec
assert sample_notification.status == expected_notification_status
@pytest.mark.parametrize('code', ['102', None, '000'])
def test_process_sms_client_response_updates_notification_status_to_pending_with_and_without_failire_code_present(
sample_notification,
mocker,
code
):
sample_notification.status = 'sending'
process_sms_client_response('2', str(sample_notification.id), 'Firetext', code)
assert sample_notification.status == 'pending'
def test_process_sms_client_response_updates_notification_status_when_code_unknown(
sample_notification,
mocker,