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

@@ -53,15 +53,11 @@ def test_get_total_sent_notifications_yesterday_returns_expected_totals_dict(sam
total_count_dict = get_total_sent_notifications_for_day(yesterday)
assert total_count_dict == {
"start_date": yesterday,
"email": {
"count": 3
},
"sms": {
"count": 2
},
"letter": {
"count": 1
}
}
assert total_count_dict["email"] == {"count": 3}
assert total_count_dict["sms"] == {"count": 2}
assert total_count_dict["letter"] == {"count": 1}
# Should return a time around midnight depending on timezones
expected_start = datetime.combine(yesterday, datetime.min.time())
time_diff = abs(expected_start - total_count_dict["start_date"])
assert time_diff <= timedelta(minutes=60)