More tweaks, trying to get tests to be clean.

Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
Cliff Hill
2024-01-10 11:18:33 -05:00
parent 908d695b54
commit ac9591ec7c
18 changed files with 37 additions and 29 deletions

View File

@@ -23,6 +23,7 @@ from app.models import (
NOTIFICATION_TEMPORARY_FAILURE,
FactNotificationStatus,
Notification,
NotificationType,
NotificationAllTimeView,
Service,
Template,
@@ -467,7 +468,7 @@ def get_total_notifications_for_date_range(start_date, end_date):
case(
[
(
FactNotificationStatus.notification_type == "email",
FactNotificationStatus.notification_type == NotificationType.EMAIL,
FactNotificationStatus.notification_count,
)
],
@@ -478,7 +479,7 @@ def get_total_notifications_for_date_range(start_date, end_date):
case(
[
(
FactNotificationStatus.notification_type == "sms",
FactNotificationStatus.notification_type == NotificationType.SMS,
FactNotificationStatus.notification_count,
)
],

View File

@@ -62,7 +62,7 @@ def _get_sms_providers_for_update(time_threshold):
# get current priority of both providers
q = (
ProviderDetails.query.filter(
ProviderDetails.notification_type == "sms", ProviderDetails.active
ProviderDetails.notification_type == NotificationType.SMS, ProviderDetails.active
)
.with_for_update()
.all()

View File

@@ -106,7 +106,7 @@ def dao_fetch_live_services_data():
case(
[
(
this_year_ft_billing.c.notification_type == "email",
this_year_ft_billing.c.notification_type == NotificationType.EMAIL,
func.sum(this_year_ft_billing.c.notifications_sent),
)
],
@@ -115,7 +115,7 @@ def dao_fetch_live_services_data():
case(
[
(
this_year_ft_billing.c.notification_type == "sms",
this_year_ft_billing.c.notification_type == NotificationType.SMS,
func.sum(this_year_ft_billing.c.notifications_sent),
)
],