mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
added more unit tests
This commit is contained in:
@@ -61,10 +61,23 @@ def test_outcome_statistics_called_for_successful_callback(sample_notification,
|
||||
success, error = process_sms_client_response(status='3', reference=reference, client_name='MMG')
|
||||
assert success == "MMG callback succeeded. reference {} updated".format(str(reference))
|
||||
assert error is None
|
||||
assert send_mock.called
|
||||
send_mock.assert_called_once_with([str(sample_notification.id)], queue="notify-internal-tasks")
|
||||
stats_mock.assert_called_once_with(sample_notification)
|
||||
|
||||
|
||||
def test_sms_resonse_does_not_call_send_callback_if_no_db_entry(sample_notification, mocker):
|
||||
mocker.patch(
|
||||
'app.notifications.process_client_response.notifications_dao.update_notification_status_by_id',
|
||||
return_value=sample_notification
|
||||
)
|
||||
send_mock = mocker.patch(
|
||||
'app.celery.service_callback_tasks.send_delivery_status_to_service.apply_async'
|
||||
)
|
||||
reference = str(uuid.uuid4())
|
||||
process_sms_client_response(status='3', reference=reference, client_name='MMG')
|
||||
send_mock.assert_not_called()
|
||||
|
||||
|
||||
def test_process_sms_response_return_success_for_send_sms_code_reference(mocker):
|
||||
stats_mock = mocker.patch('app.notifications.process_client_response.create_outcome_notification_statistic_tasks')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user