From 7f270879d6ad6261337ee48a0835e5f659d7e4e0 Mon Sep 17 00:00:00 2001 From: Alex Janousek Date: Fri, 26 Sep 2025 14:36:50 -0400 Subject: [PATCH] Missed a unit test update --- .../views/test_job_notification_updates.py | 49 ++++++------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/tests/app/main/views/test_job_notification_updates.py b/tests/app/main/views/test_job_notification_updates.py index a06d9f03a..fc7621928 100644 --- a/tests/app/main/views/test_job_notification_updates.py +++ b/tests/app/main/views/test_job_notification_updates.py @@ -46,25 +46,14 @@ def test_poll_status_notification_update_logic( job is finished (regardless of count) """ total = delivered + failed + pending - job_status = "finished" if finished else "sending" - mock_job = mocker.patch("app.job_api_client.get_job") - mock_job.return_value = { - "data": { - **job_json( - service_one["id"], - created_by=user_json(), - job_id=fake_uuid, - job_status=job_status, - notification_count=total, - notifications_requested=total, - ), - "statistics": [ - {"status": "delivered", "count": delivered}, - {"status": "failed", "count": failed}, - {"status": "pending", "count": pending}, - ], - } + mock_job_status = mocker.patch("app.job_api_client.get_job_status") + mock_job_status.return_value = { + "sent_count": delivered, + "failed_count": failed, + "pending_count": pending, + "total_count": total, + "processing_finished": finished, } response = client_request.get_response( @@ -107,23 +96,13 @@ def test_poll_status_provides_required_fields( fake_uuid, ): """Verify poll status endpoint returns all fields needed for notification update logic.""" - mock_job = mocker.patch("app.job_api_client.get_job") - mock_job.return_value = { - "data": { - **job_json( - service_one["id"], - created_by=user_json(), - job_id=fake_uuid, - job_status="sending", - notification_count=25, - notifications_requested=25, - ), - "statistics": [ - {"status": "delivered", "count": 15}, - {"status": "failed", "count": 5}, - {"status": "pending", "count": 5}, - ], - } + mock_job_status = mocker.patch("app.job_api_client.get_job_status") + mock_job_status.return_value = { + "sent_count": 15, + "failed_count": 5, + "pending_count": 5, + "total_count": 25, + "processing_finished": False, } response = client_request.get_response(