return free sms allowance in live services csv report

This commit is contained in:
Leo Hemsted
2019-05-31 12:24:18 +01:00
parent daa8868fd8
commit fb0279b820
2 changed files with 8 additions and 5 deletions

View File

@@ -220,6 +220,7 @@ def live_services_csv():
('sms_totals', 'SMS sent this year'),
('email_totals', 'Emails sent this year'),
('letter_totals', 'Letters sent this year'),
('free_sms_fragment_limit', 'Free sms allowance'),
])
# initialise with header row

View File

@@ -962,12 +962,14 @@ def test_get_live_services_report(client, platform_admin_user, mocker):
'consent_to_research': True, 'contact_name': 'Forest fairy', 'organisation_type': 'Ecosystem',
'contact_email': 'forest.fairy@digital.cabinet-office.gov.uk', 'contact_mobile': '+447700900986',
'live_date': 'Sat, 29 Mar 2014 00:00:00 GMT', 'sms_volume_intent': 100, 'email_volume_intent': 50,
'letter_volume_intent': 20, 'sms_totals': 300, 'email_totals': 1200, 'letter_totals': 0},
'letter_volume_intent': 20, 'sms_totals': 300, 'email_totals': 1200, 'letter_totals': 0,
'free_sms_fragment_limit': 100},
{'service_id': 2, 'service_name': 'james the pine tree', 'organisation_name': 'Forest',
'consent_to_research': None, 'contact_name': None, 'organisation_type': 'Ecosystem',
'contact_email': None, 'contact_mobile': None,
'live_date': None, 'sms_volume_intent': None, 'email_volume_intent': 60,
'letter_volume_intent': 0, 'sms_totals': 0, 'email_totals': 0, 'letter_totals': 0},
'letter_volume_intent': 0, 'sms_totals': 0, 'email_totals': 0, 'letter_totals': 0,
'free_sms_fragment_limit': 200},
]}
)
response = client.get(url_for('main.live_services_csv'))
@@ -976,12 +978,12 @@ def test_get_live_services_report(client, platform_admin_user, mocker):
assert report.strip() == (
'Service ID,Organisation,Organisation type,Service name,Consent to research,Main contact,Contact email,'
+ 'Contact mobile,Live date,SMS volume intent,Email volume intent,Letter volume intent,SMS sent this year,'
+ 'Emails sent this year,Letters sent this year\r\n'
+ 'Emails sent this year,Letters sent this year,Free sms allowance\r\n'
+ '1,Forest,Ecosystem,jessie the oak tree,True,Forest fairy,forest.fairy@digital.cabinet-office.gov.uk,'
+ '+447700900986,29-03-2014,100,50,20,300,1200,0\r\n'
+ '+447700900986,29-03-2014,100,50,20,300,1200,0,100\r\n'
+ '2,Forest,Ecosystem,james the pine tree,,,,,,,60,0,0,0,0'
+ '2,Forest,Ecosystem,james the pine tree,,,,,,,60,0,0,0,0,200'
)