mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 01:56:03 -04:00
A few code style tweaks to adhere to standard for better maintainable code.
This commit is contained in:
@@ -8,7 +8,10 @@ from notifications_utils.recipients import (
|
|||||||
from notifications_utils.template import HTMLEmailTemplate, PlainTextEmailTemplate, SMSMessageTemplate
|
from notifications_utils.template import HTMLEmailTemplate, PlainTextEmailTemplate, SMSMessageTemplate
|
||||||
|
|
||||||
from app import clients, statsd_client, create_uuid
|
from app import clients, statsd_client, create_uuid
|
||||||
from app.dao.notifications_dao import dao_update_notification, dao_get_notification_email_reply_for_notification
|
from app.dao.notifications_dao import (
|
||||||
|
dao_update_notification,
|
||||||
|
dao_get_notification_email_reply_for_notification
|
||||||
|
)
|
||||||
from app.dao.provider_details_dao import (
|
from app.dao.provider_details_dao import (
|
||||||
get_provider_details_by_notification_type,
|
get_provider_details_by_notification_type,
|
||||||
dao_toggle_sms_provider
|
dao_toggle_sms_provider
|
||||||
|
|||||||
@@ -1,34 +1,33 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from app import db, create_random_identifier
|
from app import db
|
||||||
from app.dao.jobs_dao import dao_create_job
|
from app.dao.jobs_dao import dao_create_job
|
||||||
from app.dao.service_inbound_api_dao import save_service_inbound_api
|
from app.dao.service_inbound_api_dao import save_service_inbound_api
|
||||||
from app.models import (
|
from app.models import (
|
||||||
ApiKey,
|
ApiKey,
|
||||||
EMAIL_TYPE,
|
|
||||||
SMS_TYPE,
|
|
||||||
KEY_TYPE_NORMAL,
|
|
||||||
Service,
|
|
||||||
User,
|
|
||||||
Template,
|
|
||||||
MonthlyBilling,
|
|
||||||
Notification,
|
|
||||||
ScheduledNotification,
|
|
||||||
ServicePermission,
|
|
||||||
Rate,
|
|
||||||
Job,
|
|
||||||
InboundSms,
|
InboundSms,
|
||||||
InboundNumber,
|
InboundNumber,
|
||||||
|
Job,
|
||||||
|
MonthlyBilling,
|
||||||
|
Notification,
|
||||||
|
NotificationEmailReplyTo,
|
||||||
Organisation,
|
Organisation,
|
||||||
|
Rate,
|
||||||
|
Service,
|
||||||
|
ServiceEmailReplyTo,
|
||||||
|
ServiceInboundApi,
|
||||||
|
ServiceLetterContact,
|
||||||
|
ScheduledNotification,
|
||||||
|
ServicePermission,
|
||||||
|
ServiceSmsSender,
|
||||||
|
Template,
|
||||||
|
User,
|
||||||
EMAIL_TYPE,
|
EMAIL_TYPE,
|
||||||
LETTER_TYPE,
|
|
||||||
SMS_TYPE,
|
SMS_TYPE,
|
||||||
INBOUND_SMS_TYPE,
|
INBOUND_SMS_TYPE,
|
||||||
KEY_TYPE_NORMAL,
|
KEY_TYPE_NORMAL
|
||||||
ServiceInboundApi,
|
)
|
||||||
ServiceEmailReplyTo,
|
|
||||||
ServiceLetterContact, ServiceSmsSender, NotificationEmailReplyTo)
|
|
||||||
from app.dao.users_dao import save_model_user
|
from app.dao.users_dao import save_model_user
|
||||||
from app.dao.notifications_dao import dao_create_notification, dao_created_scheduled_notification
|
from app.dao.notifications_dao import dao_create_notification, dao_created_scheduled_notification
|
||||||
from app.dao.templates_dao import dao_create_template
|
from app.dao.templates_dao import dao_create_template
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ from unittest.mock import ANY, call
|
|||||||
import pytest
|
import pytest
|
||||||
from notifications_utils.recipients import validate_and_format_phone_number
|
from notifications_utils.recipients import validate_and_format_phone_number
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from requests_mock import mock
|
|
||||||
|
|
||||||
import app
|
import app
|
||||||
from app import mmg_client, firetext_client
|
from app import mmg_client, firetext_client
|
||||||
@@ -22,10 +21,17 @@ from app.models import (
|
|||||||
BRANDING_ORG,
|
BRANDING_ORG,
|
||||||
BRANDING_GOVUK,
|
BRANDING_GOVUK,
|
||||||
BRANDING_BOTH,
|
BRANDING_BOTH,
|
||||||
BRANDING_ORG_BANNER, NotificationEmailReplyTo)
|
BRANDING_ORG_BANNER
|
||||||
|
)
|
||||||
|
|
||||||
from tests.app.db import create_service, create_template, create_notification, create_inbound_number, \
|
from tests.app.db import (
|
||||||
create_reply_to_email, create_reply_to_email_for_notification
|
create_service,
|
||||||
|
create_template,
|
||||||
|
create_notification,
|
||||||
|
create_inbound_number,
|
||||||
|
create_reply_to_email,
|
||||||
|
create_reply_to_email_for_notification
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_should_return_highest_priority_active_provider(restore_provider_details):
|
def test_should_return_highest_priority_active_provider(restore_provider_details):
|
||||||
|
|||||||
Reference in New Issue
Block a user