From 7fb471a10c06e5278af66784f03ac9c33e76a30e Mon Sep 17 00:00:00 2001 From: stvnrlly Date: Tue, 18 Oct 2022 20:20:09 +0000 Subject: [PATCH] test tweaks --- app/authentication/auth.py | 9 +++++---- tests/app/celery/test_process_ses_receipts_tasks.py | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/authentication/auth.py b/app/authentication/auth.py index 57842ee0c..67be729e8 100644 --- a/app/authentication/auth.py +++ b/app/authentication/auth.py @@ -18,10 +18,11 @@ from sqlalchemy.orm.exc import NoResultFound from app.serialised_models import SerialisedService -GENERAL_TOKEN_ERROR_MESSAGE = ''' - Invalid token: make sure your API token matches the example - at https://docs.notifications.service.gov.uk/rest-api.html#authorisation-header - ''' # nosec B105 +# stvnrlly - this is silly, but bandit has a multiline string bug (https://github.com/PyCQA/bandit/issues/658) +# and flake8 wants a multiline quote here. TODO: check on bug status and restore sanity once possible +TOKEN_MESSAGE_ONE = "Invalid token: make sure your API token matches the example " # nosec B105 +TOKEN_MESSAGE_TWO = "at https://docs.notifications.service.gov.uk/rest-api.html#authorisation-header" # nosec B105 +GENERAL_TOKEN_ERROR_MESSAGE = TOKEN_MESSAGE_ONE + TOKEN_MESSAGE_TWO AUTH_DB_CONNECTION_DURATION_SECONDS = Histogram( 'auth_db_connection_duration_seconds', diff --git a/tests/app/celery/test_process_ses_receipts_tasks.py b/tests/app/celery/test_process_ses_receipts_tasks.py index 896ddc079..cd54a187c 100644 --- a/tests/app/celery/test_process_ses_receipts_tasks.py +++ b/tests/app/celery/test_process_ses_receipts_tasks.py @@ -198,7 +198,8 @@ def test_ses_callback_should_log_if_notification_is_missing(client, _notify_db, assert process_ses_results(ses_notification_callback(reference='ref')) is None assert mock_retry.call_count == 0 mock_logger.assert_called_once_with( - 'notification not found for reference: ref (while attempting update to delivered)' + 'notification not found for reference: ref (while \ + attempting update to delivered)' )