From b5fdc76a4e64fa3ac767801b75522bc86d7f8eb1 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 2 Jul 2025 11:56:11 -0700 Subject: [PATCH] more tests --- .ds.baseline | 6 +++--- Makefile | 2 +- app/celery/tasks.py | 2 +- tests/app/notifications/test_receive_notification.py | 4 +++- tests/app/user/test_rest.py | 2 -- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.ds.baseline b/.ds.baseline index 15e699492..c4d01163b 100644 --- a/.ds.baseline +++ b/.ds.baseline @@ -331,7 +331,7 @@ "filename": "tests/app/user/test_rest.py", "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "is_verified": false, - "line_number": 111, + "line_number": 110, "is_secret": false }, { @@ -339,7 +339,7 @@ "filename": "tests/app/user/test_rest.py", "hashed_secret": "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33", "is_verified": false, - "line_number": 875, + "line_number": 874, "is_secret": false } ], @@ -374,5 +374,5 @@ } ] }, - "generated_at": "2025-07-02T17:46:10Z" + "generated_at": "2025-07-02T18:56:01Z" } diff --git a/Makefile b/Makefile index c1e178792..e864ba0ea 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,7 @@ test: ## Run tests and create coverage report poetry run coverage run --omit=*/migrations/*,*/tests/* -m pytest --maxfail=10 ## TODO set this back to 95 asap - poetry run coverage report -m --fail-under=93 + poetry run coverage report -m --fail-under=94 poetry run coverage html -d .coverage_cache .PHONY: test-debug diff --git a/app/celery/tasks.py b/app/celery/tasks.py index 61f7b5a20..0108981df 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -167,7 +167,7 @@ def process_row(row, template, job, service, sender_id=None): # Assuming the limit is annual, is it calendar year, fiscal year, MOU year? # Do we need a command to run to clear the redis value, or should it happen automatically? def __total_sending_limits_for_job_exceeded(service, job, job_id): - print(hilite("ENTER __total_sending_limits_for_job_exceeded")) + try: total_sent = check_service_over_total_message_limit(KeyType.NORMAL, service) if total_sent + job.notification_count > service.total_message_limit: diff --git a/tests/app/notifications/test_receive_notification.py b/tests/app/notifications/test_receive_notification.py index 7796c376b..6d1d66b72 100644 --- a/tests/app/notifications/test_receive_notification.py +++ b/tests/app/notifications/test_receive_notification.py @@ -449,4 +449,6 @@ def test_receive_sns_sms_success(client, app): date_received="2025-07-01T10:00:00:000Z", provider_name="sns", ) - mock_task.assert_called_once_with(["inbound-id", "service-id"], queue="notify-internal-tasks") + mock_task.assert_called_once_with( + ["inbound-id", "service-id"], queue="notify-internal-tasks" + ) diff --git a/tests/app/user/test_rest.py b/tests/app/user/test_rest.py index 4ecd373c8..1223487ab 100644 --- a/tests/app/user/test_rest.py +++ b/tests/app/user/test_rest.py @@ -12,7 +12,6 @@ from app import db from app.dao.service_user_dao import dao_get_service_user, dao_update_service_user from app.enums import AuthType, KeyType, NotificationType, PermissionType from app.models import Notification, Permission, User -from app.utils import hilite from tests.app.db import ( create_organization, create_service, @@ -1076,7 +1075,6 @@ def test_get_user_login_gov_user(notify_db_session, admin_request): _data=data, ) - print(hilite(users["data"])) assert users["data"]["email_address"] == "findel.mestro@foo.com"