rename clients to notification_provider_clients

i think it's causing havoc with my attempts to mock stuff in the
`app.clients` directory because it's also accessible at that path. the
name's super vague and doesn't explain what it is anyway
This commit is contained in:
Leo Hemsted
2020-11-17 12:35:18 +00:00
parent 5924de9c14
commit 732c203d3e
5 changed files with 13 additions and 10 deletions

View File

@@ -5,7 +5,7 @@ from freezegun import freeze_time
from sqlalchemy.sql import desc
from app.models import ProviderDetails, ProviderDetailsHistory
from app import clients
from app import notification_provider_clients
from app.dao.provider_details_dao import (
get_alternative_sms_provider,
get_provider_details_by_identifier,
@@ -76,7 +76,7 @@ def test_can_get_email_providers(notify_db_session):
def test_should_not_error_if_any_provider_in_code_not_in_database(restore_provider_details):
ProviderDetails.query.filter_by(identifier='mmg').delete()
assert clients.get_sms_client('mmg')
assert notification_provider_clients.get_sms_client('mmg')
@freeze_time('2000-01-01T00:00:00')

View File

@@ -9,7 +9,7 @@ from notifications_utils.recipients import validate_and_format_phone_number
from requests import HTTPError
import app
from app import clients, mmg_client, firetext_client
from app import notification_provider_clients, mmg_client, firetext_client
from app.dao import notifications_dao
from app.dao.provider_details_dao import get_provider_details_by_identifier
from app.delivery import send_to_providers
@@ -535,7 +535,10 @@ def test_update_notification_to_sending_does_not_update_status_from_a_final_stat
):
template = create_template(sample_service)
notification = create_notification(template=template, status=starting_status)
send_to_providers.update_notification_to_sending(notification, clients.get_client_by_name_and_type("mmg", "sms"))
send_to_providers.update_notification_to_sending(
notification,
notification_provider_clients.get_client_by_name_and_type("mmg", "sms")
)
assert notification.status == expected_status