diff --git a/tests/app/celery/test_process_pinpoint_receipts_tasks.py b/tests/app/celery/test_process_pinpoint_receipts_tasks.py index 8191c93993..ea9bfc0654 100644 --- a/tests/app/celery/test_process_pinpoint_receipts_tasks.py +++ b/tests/app/celery/test_process_pinpoint_receipts_tasks.py @@ -29,8 +29,14 @@ ) -@pytest.mark.parametrize("callback", [pinpoint_delivered_callback, pinpoint_shortcode_delivered_callback]) -def test_process_pinpoint_results_delivered(sample_template, notify_db, notify_db_session, callback, mocker): +@pytest.mark.parametrize( + "callback, expected_response", + [ + (pinpoint_delivered_callback, "Message has been accepted by phone"), + (pinpoint_shortcode_delivered_callback, "Message has been accepted by phone carrier"), + ], +) +def test_process_pinpoint_results_delivered(sample_template, notify_db, notify_db_session, callback, expected_response, mocker): mock_logger = mocker.patch("app.celery.process_pinpoint_receipts_tasks.current_app.logger.info") mock_callback_task = mocker.patch("app.notifications.callbacks._check_and_queue_callback_task") @@ -49,7 +55,7 @@ def test_process_pinpoint_results_delivered(sample_template, notify_db, notify_d assert mock_callback_task.called_once_with(get_notification_by_id(notification.id)) assert get_notification_by_id(notification.id).status == NOTIFICATION_DELIVERED - assert get_notification_by_id(notification.id).provider_response == "Message has been accepted by phone" + assert get_notification_by_id(notification.id).provider_response == expected_response mock_logger.assert_called_once_with(f"Pinpoint callback return status of delivered for notification: {notification.id}")