mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
fix nightly ft stats tables task to respect BST
the create_nightly_notification_status task runs at 00:30am UK time, however this means that in summer datetime.today() will return the wrong date as the server (which runs on UTC) will run the task at 23:30 (populating the wrong row in the table). fix this to use nice tz aware functions
This commit is contained in:
@@ -38,7 +38,7 @@ def test_update_fact_notification_status(notify_db_session):
|
||||
|
||||
process_day = datetime.utcnow()
|
||||
data = fetch_notification_status_for_day(process_day=process_day)
|
||||
update_fact_notification_status(data=data, process_day=process_day)
|
||||
update_fact_notification_status(data=data, process_day=process_day.date())
|
||||
|
||||
new_fact_data = FactNotificationStatus.query.order_by(FactNotificationStatus.bst_date,
|
||||
FactNotificationStatus.notification_type
|
||||
@@ -77,7 +77,7 @@ def test__update_fact_notification_status_updates_row(notify_db_session):
|
||||
|
||||
process_day = datetime.utcnow()
|
||||
data = fetch_notification_status_for_day(process_day=process_day)
|
||||
update_fact_notification_status(data=data, process_day=process_day)
|
||||
update_fact_notification_status(data=data, process_day=process_day.date())
|
||||
|
||||
new_fact_data = FactNotificationStatus.query.order_by(FactNotificationStatus.bst_date,
|
||||
FactNotificationStatus.notification_type
|
||||
@@ -88,7 +88,7 @@ def test__update_fact_notification_status_updates_row(notify_db_session):
|
||||
create_notification(template=first_template, status='delivered')
|
||||
|
||||
data = fetch_notification_status_for_day(process_day=process_day)
|
||||
update_fact_notification_status(data=data, process_day=process_day)
|
||||
update_fact_notification_status(data=data, process_day=process_day.date())
|
||||
|
||||
updated_fact_data = FactNotificationStatus.query.order_by(FactNotificationStatus.bst_date,
|
||||
FactNotificationStatus.notification_type
|
||||
|
||||
Reference in New Issue
Block a user