mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-03 13:18:32 -04:00
remove datetime.utcnow()
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from unittest.mock import Mock, call
|
||||
|
||||
import pytest
|
||||
from freezegun import freeze_time
|
||||
|
||||
from app.utils import utc_now
|
||||
from notifications_utils.clients.redis.redis_client import RedisClient, prepare_value
|
||||
|
||||
|
||||
@@ -208,9 +208,7 @@ def test_delete_multi(mocked_redis_client):
|
||||
(1.2, 1.2),
|
||||
(uuid.UUID(int=0), "00000000-0000-0000-0000-000000000000"),
|
||||
pytest.param({"a": 1}, None, marks=pytest.mark.xfail(raises=ValueError)),
|
||||
pytest.param(
|
||||
datetime.utcnow(), None, marks=pytest.mark.xfail(raises=ValueError)
|
||||
),
|
||||
pytest.param(utc_now(), None, marks=pytest.mark.xfail(raises=ValueError)),
|
||||
],
|
||||
)
|
||||
def test_prepare_value(input, output):
|
||||
|
||||
@@ -4,6 +4,7 @@ import pytest
|
||||
import pytz
|
||||
from freezegun import freeze_time
|
||||
|
||||
from app.utils import utc_now
|
||||
from notifications_utils.letter_timings import (
|
||||
get_letter_timings,
|
||||
letter_can_be_cancelled,
|
||||
@@ -188,7 +189,7 @@ def test_get_estimated_delivery_date_for_letter(
|
||||
def test_letter_cannot_be_cancelled_if_letter_status_is_not_created_or_pending_virus_check(
|
||||
status,
|
||||
):
|
||||
notification_created_at = datetime.utcnow()
|
||||
notification_created_at = utc_now()
|
||||
|
||||
assert not letter_can_be_cancelled(status, notification_created_at)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user