mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-06 10:48:26 -04:00
Refactor the get_midnight functions to return the date in UTC but for the localised time.
So in June when we are in BST June 16, 00:00 BST => June 15 23:00 UTC
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
from datetime import datetime, timedelta, date
|
||||
import pytz
|
||||
import uuid
|
||||
from functools import partial
|
||||
|
||||
@@ -47,7 +46,7 @@ from app.dao.notifications_dao import (
|
||||
from app.dao.services_dao import dao_update_service
|
||||
|
||||
from app.utils import (
|
||||
get_midnight_for_date,
|
||||
get_london_midnight_in_utc,
|
||||
get_midnight_for_day_before
|
||||
)
|
||||
|
||||
@@ -1489,7 +1488,7 @@ def test_get_total_sent_notifications_yesterday_returns_expected_totals_dict(
|
||||
|
||||
assert total_count_dict == {
|
||||
"start_date": get_midnight_for_day_before(datetime.utcnow()),
|
||||
"end_date": get_midnight_for_date(datetime.utcnow()),
|
||||
"end_date": get_london_midnight_in_utc(datetime.utcnow()),
|
||||
"email": {
|
||||
"count": 3
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user