diff --git a/app/celery/send_va_profile_notification_status.py b/app/celery/send_va_profile_notification_status.py index 2ff8875da3..ed87569326 100644 --- a/app/celery/send_va_profile_notification_status.py +++ b/app/celery/send_va_profile_notification_status.py @@ -61,11 +61,11 @@ def send_notification_status_to_va_profile(notification_data: dict) -> None: """ try: - va_profile_client.send_va_profile_email_status(notification_data) + va_profile_client.send_va_profile_notification_status(notification_data) except requests.Timeout: - # logging in send_va_profile_email_status + # logging in send_va_profile_notification_status raise AutoRetryException except requests.RequestException: - # logging in send_va_profile_email_status + # logging in send_va_profile_notification_status # In this case the error is being handled by not retrying this celery task pass diff --git a/app/va/va_profile/va_profile_client.py b/app/va/va_profile/va_profile_client.py index 1daabc27ad..532cc522b8 100644 --- a/app/va/va_profile/va_profile_client.py +++ b/app/va/va_profile/va_profile_client.py @@ -352,7 +352,7 @@ def _handle_exceptions(self, va_profile_id_value: str, error: Exception): raise exception from error - def send_va_profile_email_status(self, notification_data: dict) -> None: + def send_va_profile_notification_status(self, notification_data: dict) -> None: """ This method sends notification status data to VA Profile. This is part of our integration to help VA Profile provide better service by letting them know which emails and phone numbers are good, and which ones result in bounces. diff --git a/tests/app/celery/test_process_ses_receipts_tasks.py b/tests/app/celery/test_process_ses_receipts_tasks.py index 7410f2b85d..067e6ad5e3 100644 --- a/tests/app/celery/test_process_ses_receipts_tasks.py +++ b/tests/app/celery/test_process_ses_receipts_tasks.py @@ -644,24 +644,24 @@ def mock_notification(self) -> Notification: return notification_mock def test_ut_send_email_status_to_va_profile(self, mocker): - mock_send_va_profile_email_status = mocker.patch( - 'app.celery.send_va_profile_notification_status.va_profile_client.send_va_profile_email_status' + mock_send_va_profile_notification_status = mocker.patch( + 'app.celery.send_va_profile_notification_status.va_profile_client.send_va_profile_notification_status' ) send_notification_status_to_va_profile(self.mock_notification_data) - mock_send_va_profile_email_status.assert_called_once_with(self.mock_notification_data) + mock_send_va_profile_notification_status.assert_called_once_with(self.mock_notification_data) def test_ut_send_email_status_to_va_profile_raises_auto_retry_exception(self, mocker): - mock_send_va_profile_email_status = mocker.patch( - 'app.celery.send_va_profile_notification_status.va_profile_client.send_va_profile_email_status', + mock_send_va_profile_notification_status = mocker.patch( + 'app.celery.send_va_profile_notification_status.va_profile_client.send_va_profile_notification_status', side_effect=[ConnectTimeout, ReadTimeout], ) with pytest.raises(AutoRetryException): send_notification_status_to_va_profile(self.mock_notification_data) - mock_send_va_profile_email_status.assert_called_once() + mock_send_va_profile_notification_status.assert_called_once() @pytest.mark.parametrize('status', (NOTIFICATION_PERMANENT_FAILURE, NOTIFICATION_TEMPORARY_FAILURE)) diff --git a/tests/app/va/va_profile/test_va_profile_client.py b/tests/app/va/va_profile/test_va_profile_client.py index 0faa566ad8..fe343db446 100644 --- a/tests/app/va/va_profile/test_va_profile_client.py +++ b/tests/app/va/va_profile/test_va_profile_client.py @@ -499,32 +499,32 @@ class TestSendEmailStatus: 'provider': 'ses', # email provider } - def test_send_va_profile_email_status_sent_successfully(self, rmock, mock_va_profile_client, mocker): + def test_send_va_profile_notification_status_sent_successfully(self, rmock, mock_va_profile_client, mocker): rmock.post(requests_mock.ANY, json=self.mock_response, status_code=200) - mock_va_profile_client.send_va_profile_email_status(self.mock_notification_data) + mock_va_profile_client.send_va_profile_notification_status(self.mock_notification_data) assert rmock.called expected_url = f'{MOCK_VA_PROFILE_URL}/contact-information-vanotify/notify/status' assert rmock.request_history[0].url == expected_url - def test_send_va_profile_email_status_timeout(self, rmock, mock_va_profile_client, mocker): + def test_send_va_profile_notification_status_timeout(self, rmock, mock_va_profile_client, mocker): rmock.post(requests_mock.ANY, exc=requests.ReadTimeout) with pytest.raises(requests.Timeout): - mock_va_profile_client.send_va_profile_email_status(self.mock_notification_data) + mock_va_profile_client.send_va_profile_notification_status(self.mock_notification_data) assert rmock.called expected_url = f'{MOCK_VA_PROFILE_URL}/contact-information-vanotify/notify/status' assert rmock.request_history[0].url == expected_url - def test_send_va_profile_email_status_throws_exception(self, rmock, mock_va_profile_client, mocker): + def test_send_va_profile_notification_status_throws_exception(self, rmock, mock_va_profile_client, mocker): rmock.post(requests_mock.ANY, exc=requests.RequestException) with pytest.raises(requests.RequestException): - mock_va_profile_client.send_va_profile_email_status(self.mock_notification_data) + mock_va_profile_client.send_va_profile_notification_status(self.mock_notification_data) assert rmock.called