fix tests

This commit is contained in:
Kenneth Kehl
2024-07-31 14:21:30 -07:00
parent 1e26511dc6
commit e244278ccf
2 changed files with 24 additions and 6 deletions

View File

@@ -318,6 +318,9 @@ def test_should_send_sms_with_downgraded_content(notify_db_session, mocker):
# é, o, and u are in GSM.
# ī, grapes, tabs, zero width space and ellipsis are not
# ó isn't in GSM, but it is in the welsh alphabet so will still be sent
mocker.patch(
"app.delivery.send_to_providers.get_sender_numbers", return_value=["testing"]
)
msg = "a é ī o u 🍇 foo\tbar\u200bbaz((misc))…"
placeholder = "∆∆∆abc"
gsm_message = "?ódz Housing Service: a é i o u ? foo barbaz???abc..."
@@ -609,6 +612,10 @@ def __update_notification(notification_to_update, research_mode, expected_status
def test_should_update_billable_units_and_status_according_to_research_mode_and_key_type(
sample_template, mocker, research_mode, key_type, billable_units, expected_status
):
mocker.patch(
"app.delivery.send_to_providers.get_sender_numbers", return_value=["testing"]
)
notification = create_notification(
template=sample_template,
billable_units=0,
@@ -771,6 +778,10 @@ def test_send_email_to_provider_uses_reply_to_from_notification(
def test_send_sms_to_provider_should_use_normalised_to(mocker, client, sample_template):
mocker.patch(
"app.delivery.send_to_providers.get_sender_numbers", return_value=["testing"]
)
send_mock = mocker.patch("app.aws_sns_client.send_sms")
notification = create_notification(
template=sample_template, to_field="+12028675309", normalised_to="2028675309"
@@ -826,6 +837,10 @@ def test_send_email_to_provider_should_user_normalised_to(
def test_send_sms_to_provider_should_return_template_if_found_in_redis(
mocker, client, sample_template
):
mocker.patch(
"app.delivery.send_to_providers.get_sender_numbers", return_value=["testing"]
)
from app.schemas import service_schema, template_schema
service_dict = service_schema.dump(sample_template.service)