mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
migrate bst_date to local_date
This commit is contained in:
@@ -1762,7 +1762,7 @@ def test_get_service_ids_with_notifications_on_date_checks_ft_status(
|
||||
sample_template,
|
||||
):
|
||||
create_notification(template=sample_template, created_at='2022-01-01T09:30')
|
||||
create_ft_notification_status(template=sample_template, bst_date='2022-01-02')
|
||||
create_ft_notification_status(template=sample_template, local_date='2022-01-02')
|
||||
|
||||
assert len(get_service_ids_with_notifications_on_date(SMS_TYPE, date(2022, 1, 1))) == 1
|
||||
assert len(get_service_ids_with_notifications_on_date(SMS_TYPE, date(2022, 1, 2))) == 1
|
||||
|
||||
@@ -4,11 +4,11 @@ from app.dao.notifications_dao import dao_get_last_date_template_was_used
|
||||
from tests.app.db import create_ft_notification_status, create_notification
|
||||
|
||||
|
||||
def test_dao_get_last_date_template_was_used_returns_bst_date_from_stats_table(
|
||||
def test_dao_get_last_date_template_was_used_returns_local_date_from_stats_table(
|
||||
sample_template
|
||||
):
|
||||
last_status_date = (datetime.utcnow() - timedelta(days=2)).date()
|
||||
create_ft_notification_status(bst_date=last_status_date,
|
||||
create_ft_notification_status(local_date=last_status_date,
|
||||
template=sample_template)
|
||||
|
||||
last_used_date = dao_get_last_date_template_was_used(template_id=sample_template.id,
|
||||
@@ -23,7 +23,7 @@ def test_dao_get_last_date_template_was_used_returns_created_at_from_notificatio
|
||||
create_notification(template=sample_template, created_at=last_notification_date)
|
||||
|
||||
last_status_date = (datetime.utcnow() - timedelta(days=2)).date()
|
||||
create_ft_notification_status(bst_date=last_status_date, template=sample_template)
|
||||
create_ft_notification_status(local_date=last_status_date, template=sample_template)
|
||||
last_used_date = dao_get_last_date_template_was_used(template_id=sample_template.id,
|
||||
service_id=sample_template.service_id)
|
||||
assert last_used_date == last_notification_date
|
||||
|
||||
Reference in New Issue
Block a user