Even more cleanup of tests.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-02-09 15:23:24 -05:00
parent f27964812c
commit acecf9792d
3 changed files with 35 additions and 32 deletions

View File

@@ -12,6 +12,7 @@ from app.dao.inbound_sms_dao import (
dao_get_paginated_most_recent_inbound_sms_by_user_number_for_service,
delete_inbound_sms_older_than_retention,
)
from app.enums import NotificationType
from app.models import InboundSmsHistory
from tests.app.db import (
create_inbound_sms,
@@ -65,10 +66,10 @@ def test_get_all_inbound_sms_filters_on_service(notify_db_session):
def test_get_all_inbound_sms_filters_on_time(sample_service, notify_db_session):
create_inbound_sms(
sample_service, created_at=datetime(2017, 8, 6, 23, 59)
sample_service, created_at=datetime(2017, 8, 6, 23, 59),
) # sunday evening
sms_two = create_inbound_sms(
sample_service, created_at=datetime(2017, 8, 7, 0, 0)
sample_service, created_at=datetime(2017, 8, 7, 0, 0),
) # monday (7th) morning
with freeze_time("2017-08-14 12:00"):
@@ -110,13 +111,13 @@ def test_should_delete_inbound_sms_according_to_data_retention(notify_db_session
services = [short_retention_service, no_retention_service, long_retention_service]
create_service_data_retention(
long_retention_service, notification_type="sms", days_of_retention=30
long_retention_service, notification_type=NotificationType.SMS, days_of_retention=30,
)
create_service_data_retention(
short_retention_service, notification_type="sms", days_of_retention=3
short_retention_service, notification_type=NotificationType.SMS, days_of_retention=3,
)
create_service_data_retention(
short_retention_service, notification_type="email", days_of_retention=4
short_retention_service, notification_type=NotificationType.EMAIL, days_of_retention=4,
)
dates = [