From f4b20911a154222af9b3f6970c7d79eabf567954 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 22 Aug 2025 09:28:25 -0700 Subject: [PATCH] fix test --- app/job/rest.py | 3 --- tests/app/job/test_rest.py | 9 +++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/job/rest.py b/app/job/rest.py index 813a4cbf8..1e8ee19d8 100644 --- a/app/job/rest.py +++ b/app/job/rest.py @@ -76,13 +76,11 @@ def cancel_job(service_id, job_id): @job_blueprint.route("//notifications", methods=["GET"]) def get_all_notifications_for_service_job(service_id, job_id): - current_app.logger.info(hilite("ENTER get_all_notifications_for_service_job")) check_suspicious_id(service_id, job_id) job = get_job_from_s3(service_id, job_id) phones = extract_phones(job, service_id, job_id) personalisation = extract_personalisation(job) - current_app.logger.info(hilite(f"PHONES {phones}")) data = notifications_filter_schema.load(request.args) page = data["page"] if "page" in data else 1 page_size = ( @@ -93,7 +91,6 @@ def get_all_notifications_for_service_job(service_id, job_id): paginated_notifications = get_notifications_for_job( service_id, job_id, filter_dict=data, page=page, page_size=page_size ) - current_app.logger.info(hilite("Got paginated notifications")) kwargs = request.args.to_dict() kwargs["service_id"] = service_id diff --git a/tests/app/job/test_rest.py b/tests/app/job/test_rest.py index 75ebe4490..fc4150aa8 100644 --- a/tests/app/job/test_rest.py +++ b/tests/app/job/test_rest.py @@ -947,10 +947,12 @@ def test_get_all_notifications_for_job_returns_csv_format( mock_job = mocker.patch("app.job.rest.get_job_from_s3") mock_job.return_value = None mock_s3 = mocker.patch("app.job.rest.extract_phones") - mock_s3.return_value = {"0": "15555555555"} - + mock_s3.return_value = {0: "15555555555"} mock_s3_personalisation = mocker.patch("app.job.rest.extract_personalisation") - mock_s3_personalisation.return_value = {"0": ""} + mock_s3_personalisation.return_value = {0: ""} + + assert sample_notification_with_job.job_row_number == 0 + current_app.logger.info(f"HERE {sample_notification_with_job.serialize_for_csv()}") resp = admin_request.get( "job.get_all_notifications_for_service_job", @@ -958,7 +960,6 @@ def test_get_all_notifications_for_job_returns_csv_format( job_id=sample_notification_with_job.job_id, format_for_csv=True, ) - current_app.logger.info(f"NOTIFICATIONS {resp['notifications']}") assert len(resp["notifications"]) == 1 assert set(resp["notifications"][0].keys()) == { "created_at",