mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-08 18:13:11 -04:00
Cleaning up "email" from code.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
This commit is contained in:
@@ -7,6 +7,7 @@ from app.dao.complaint_dao import (
|
||||
fetch_paginated_complaints,
|
||||
save_complaint,
|
||||
)
|
||||
from app.enums import TemplateType
|
||||
from app.models import Complaint
|
||||
from tests.app.db import (
|
||||
create_complaint,
|
||||
@@ -72,8 +73,8 @@ def test_fetch_complaint_by_service_returns_empty_list(sample_service):
|
||||
def test_fetch_complaint_by_service_return_many(notify_db_session):
|
||||
service_1 = create_service(service_name="first")
|
||||
service_2 = create_service(service_name="second")
|
||||
template_1 = create_template(service=service_1, template_type="email")
|
||||
template_2 = create_template(service=service_2, template_type="email")
|
||||
template_1 = create_template(service=service_1, template_type=TemplateType.EMAIL)
|
||||
template_2 = create_template(service=service_2, template_type=TemplateType.EMAIL)
|
||||
notification_1 = create_notification(template=template_1)
|
||||
notification_2 = create_notification(template=template_2)
|
||||
notification_3 = create_notification(template=template_2)
|
||||
@@ -138,13 +139,13 @@ def test_fetch_count_of_complaints(sample_email_notification):
|
||||
)
|
||||
|
||||
count_of_complaints = fetch_count_of_complaints(
|
||||
start_date=datetime(2018, 6, 7), end_date=datetime(2018, 6, 7)
|
||||
start_date=datetime(2018, 6, 7), end_date=datetime(2018, 6, 7),
|
||||
)
|
||||
assert count_of_complaints == 5
|
||||
|
||||
|
||||
def test_fetch_count_of_complaints_returns_zero(notify_db_session):
|
||||
count_of_complaints = fetch_count_of_complaints(
|
||||
start_date=datetime(2018, 6, 7), end_date=datetime(2018, 6, 7)
|
||||
start_date=datetime(2018, 6, 7), end_date=datetime(2018, 6, 7),
|
||||
)
|
||||
assert count_of_complaints == 0
|
||||
|
||||
@@ -57,7 +57,7 @@ def test_fetch_service_data_retention_returns_empty_list_when_no_rows_for_servic
|
||||
|
||||
|
||||
def test_fetch_service_data_retention_by_id(sample_service):
|
||||
email_data_retention = insert_service_data_retention(sample_service.id, "email", 3)
|
||||
email_data_retention = insert_service_data_retention(sample_service.id, NotificationType.EMAIL, 3,)
|
||||
insert_service_data_retention(sample_service.id, NotificationType.SMS, 13)
|
||||
result = fetch_service_data_retention_by_id(
|
||||
sample_service.id, email_data_retention.id
|
||||
|
||||
@@ -511,7 +511,7 @@ def test_dao_fetch_live_services_data(sample_user):
|
||||
create_service(service_name="restricted", restricted=True)
|
||||
create_service(service_name="not_active", active=False)
|
||||
create_service(service_name="not_live", count_as_live=False)
|
||||
email_template = create_template(service=service, template_type="email")
|
||||
email_template = create_template(service=service, template_type=TemplateType.EMAIL)
|
||||
dao_add_service_to_organization(service=service, organization_id=org.id)
|
||||
# two sms billing records for 1st service within current financial year:
|
||||
create_ft_billing(local_date="2019-04-20", template=sms_template)
|
||||
@@ -1217,8 +1217,8 @@ def test_dao_fetch_todays_stats_for_all_services_only_includes_today(notify_db_s
|
||||
stats = dao_fetch_todays_stats_for_all_services()
|
||||
|
||||
stats = {row.status: row.count for row in stats}
|
||||
assert "delivered" not in stats
|
||||
assert stats["failed"] == 1
|
||||
assert NotificationStatus.DELIVERED not in stats
|
||||
assert stats[NotificationStatus.FAILED] == 1
|
||||
|
||||
|
||||
def test_dao_fetch_todays_stats_for_all_services_groups_correctly(notify_db_session):
|
||||
|
||||
Reference in New Issue
Block a user