Fix sending of performance platform

The pp client converts to UTC using the convert_utc_to_bst notify util.

This requires a datatime not a date, pass it a datetime, and add an
assertion in an existing test.

I didn't want to use the midnight conversion util in the test.

Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
This commit is contained in:
Toby Lorne
2019-04-02 08:25:09 +01:00
parent 1250e47cc7
commit 4abbb7137a
2 changed files with 12 additions and 13 deletions

View File

@@ -1,5 +1,6 @@
from app import performance_platform_client
from app.dao.fact_notification_status_dao import get_total_sent_notifications_for_day_and_type
from app.utils import get_london_midnight_in_utc
def send_total_notifications_sent_for_day_stats(date, notification_type, count):
@@ -19,8 +20,10 @@ def get_total_sent_notifications_for_day(day):
sms_count = get_total_sent_notifications_for_day_and_type(day, 'sms')
letter_count = get_total_sent_notifications_for_day_and_type(day, 'letter')
start_date = get_london_midnight_in_utc(day)
return {
"start_date": day,
"start_date": start_date,
"email": {
"count": email_count
},