Only count_as_live services

Add comments to live services dao test for context
This commit is contained in:
Pea Tyczynska
2019-04-29 16:30:31 +01:00
parent c15d7878fc
commit 382d1de857
2 changed files with 10 additions and 0 deletions

View File

@@ -391,15 +391,21 @@ def test_dao_fetch_live_services_data(sample_user, mock):
template = create_template(service=service)
service_2 = create_service(service_name='second', go_live_user=sample_user)
create_service(service_name='third')
create_service(service_name='not_live', count_as_live=False)
template2 = create_template(service=service, template_type='email')
template_letter_1 = create_template(service=service, template_type='letter')
template_letter_2 = create_template(service=service_2, template_type='letter')
dao_add_service_to_organisation(service=service, organisation_id=org.id)
# two sms billing records for 1st service within current financial year:
create_ft_billing(bst_date='2019-04-20', notification_type='sms', template=template, service=service)
create_ft_billing(bst_date='2019-04-21', notification_type='sms', template=template, service=service)
# one sms billing record for 1st service from previous financial year, should not appear in the result:
create_ft_billing(bst_date='2018-04-20', notification_type='sms', template=template, service=service)
# one email billing record for 1st service within current financial year:
create_ft_billing(bst_date='2019-04-20', notification_type='email', template=template2, service=service)
# one letter billing record for 1st service within current financial year:
create_ft_billing(bst_date='2019-04-15', notification_type='letter', template=template_letter_1, service=service)
# one letter billing record for 2nd service within current financial year:
create_ft_billing(bst_date='2019-04-16', notification_type='letter', template=template_letter_2, service=service_2)
results = dao_fetch_live_services_data()