diff --git a/tests/app/clients/test_aws_cloudwatch.py b/tests/app/clients/test_aws_cloudwatch.py index 5f25f1d9f..6662d2edb 100644 --- a/tests/app/clients/test_aws_cloudwatch.py +++ b/tests/app/clients/test_aws_cloudwatch.py @@ -1,4 +1,6 @@ # import pytest +from datetime import datetime + from flask import current_app from app import aws_cloudwatch_client @@ -61,8 +63,9 @@ def test_check_sms_success(notify_api, mocker): message_id = "succeed" notification_id = "ccc" + created_at = datetime.utcnow() with notify_api.app_context(): - aws_cloudwatch_client.check_sms(message_id, notification_id, 1000000000000) + aws_cloudwatch_client.check_sms(message_id, notification_id, created_at) # We check the 'success' log group first and if we find the message_id, we are done, so there is only 1 call assert boto_mock.filter_log_events.call_count == 1 @@ -82,8 +85,9 @@ def test_check_sms_failure(notify_api, mocker): ) message_id = "fail" notification_id = "bbb" + created_at = datetime.utcnow() with notify_api.app_context(): - aws_cloudwatch_client.check_sms(message_id, notification_id, 1000000000000) + aws_cloudwatch_client.check_sms(message_id, notification_id, created_at) # We check the 'success' log group and find nothing, so we then check the 'fail' log group -- two calls. assert boto_mock.filter_log_events.call_count == 2