mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
add tests for new statistics and fact notification status functions
This commit is contained in:
@@ -35,6 +35,7 @@ from app.models import (
|
||||
LetterRate,
|
||||
InvitedOrganisationUser,
|
||||
FactBilling,
|
||||
FactNotificationStatus,
|
||||
Complaint
|
||||
)
|
||||
from app.dao.users_dao import save_model_user
|
||||
@@ -565,6 +566,36 @@ def create_ft_billing(bst_date,
|
||||
return data
|
||||
|
||||
|
||||
def create_ft_notification_status(
|
||||
bst_date,
|
||||
notification_type,
|
||||
service=None,
|
||||
template=None,
|
||||
job=None,
|
||||
key_type='normal',
|
||||
notification_status='delivered',
|
||||
count=1
|
||||
):
|
||||
if not service:
|
||||
service = create_service()
|
||||
if not template:
|
||||
template = create_template(service=service, template_type=notification_type)
|
||||
|
||||
data = FactNotificationStatus(
|
||||
bst_date=bst_date,
|
||||
template_id=template.id,
|
||||
service_id=service.id,
|
||||
job_id=job.id if job else uuid.UUID(int=0),
|
||||
notification_type=notification_type,
|
||||
key_type=key_type,
|
||||
notification_status=notification_status,
|
||||
notification_count=count
|
||||
)
|
||||
db.session.add(data)
|
||||
db.session.commit()
|
||||
return data
|
||||
|
||||
|
||||
def create_complaint(service=None,
|
||||
notification=None,
|
||||
created_at=None):
|
||||
|
||||
Reference in New Issue
Block a user