fix tests

This commit is contained in:
Kenneth Kehl
2023-11-03 08:28:21 -07:00
parent 7d2dc776b9
commit 9c841320ca
6 changed files with 29 additions and 15 deletions

View File

@@ -30,7 +30,8 @@ def side_effect(filterPattern, logGroupName, startTime, endTime):
"events": [
{
"logStreamName": "89db9712-c6d1-49f9-be7c-4caa7ed9efb1",
"message": '{"delivery":{"destination":"+1661","providerResponse":"Invalid phone number"}}',
"message": '{"delivery":{"destination":"+1661","phoneCarrier":"ATT Mobility", '
'"providerResponse":"Invalid phone number"}}',
"eventId": "37535432778099870001723210579798865345508698025292922880",
}
]
@@ -42,7 +43,8 @@ def side_effect(filterPattern, logGroupName, startTime, endTime):
{
"logStreamName": "89db9712-c6d1-49f9-be7c-4caa7ed9efb1",
"timestamp": 1683147017911,
"message": '{"delivery":{"destination":"+1661","providerResponse":"Phone accepted msg"}}',
"message": '{"delivery":{"destination":"+1661","phoneCarrier":"ATT Mobility",'
'"providerResponse":"Phone accepted msg"}}',
"ingestionTime": 1683147018026,
"eventId": "37535432778099870001723210579798865345508698025292922880",
}

View File

@@ -111,7 +111,7 @@ def test_should_be_able_to_sanitize_successful_notification(
with freeze_time("2000-01-02 12:00:00"):
sanitize_successful_notification_by_id(
notification.id, provider_response="Don't know what happened"
notification.id, carrier="ATT", provider_response="Don't know what happened"
)
assert Notification.query.get(notification.id).status == "delivered"
assert Notification.query.get(notification.id).normalised_to == "1"

View File

@@ -67,6 +67,7 @@ def test_get_notification_by_id_returns_200(
"completed_at": sample_notification.completed_at(),
"scheduled_for": None,
"provider_response": None,
"carrier": None,
}
assert json_response == expected_response
@@ -122,6 +123,7 @@ def test_get_notification_by_id_with_placeholders_returns_200(
"completed_at": sample_notification.completed_at(),
"scheduled_for": None,
"provider_response": None,
"carrier": None
}
assert json_response == expected_response