mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-30 03:08:32 -04:00
code review feedback, fix setup.cfg and reformat
This commit is contained in:
@@ -16,16 +16,9 @@ from app.authentication.auth import (
|
||||
requires_auth,
|
||||
requires_internal_auth,
|
||||
)
|
||||
from app.dao.api_key_dao import (
|
||||
expire_api_key,
|
||||
get_model_api_keys,
|
||||
get_unsigned_secrets,
|
||||
)
|
||||
from app.dao.api_key_dao import expire_api_key, get_model_api_keys, get_unsigned_secrets
|
||||
from app.dao.services_dao import dao_fetch_service_by_id
|
||||
from tests import (
|
||||
create_admin_authorization_header,
|
||||
create_service_authorization_header,
|
||||
)
|
||||
from tests import create_admin_authorization_header, create_service_authorization_header
|
||||
from tests.conftest import set_config_values
|
||||
|
||||
|
||||
|
||||
@@ -4,9 +4,7 @@ from unittest import mock
|
||||
from unittest.mock import ANY, call
|
||||
|
||||
import pytest
|
||||
from notifications_utils.clients.zendesk.zendesk_client import (
|
||||
NotifySupportTicket,
|
||||
)
|
||||
from notifications_utils.clients.zendesk.zendesk_client import NotifySupportTicket
|
||||
|
||||
from app.celery import scheduled_tasks
|
||||
from app.celery.scheduled_tasks import (
|
||||
|
||||
@@ -8,10 +8,7 @@ import requests_mock
|
||||
from celery.exceptions import Retry
|
||||
from freezegun import freeze_time
|
||||
from notifications_utils.recipients import Row
|
||||
from notifications_utils.template import (
|
||||
PlainTextEmailTemplate,
|
||||
SMSMessageTemplate,
|
||||
)
|
||||
from notifications_utils.template import PlainTextEmailTemplate, SMSMessageTemplate
|
||||
from requests import RequestException
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
@@ -719,10 +716,7 @@ def test_save_email_should_use_template_version_from_job_not_latest(
|
||||
notification = _notification_json(sample_email_template, "my_email@my_email.com")
|
||||
version_on_notification = sample_email_template.version
|
||||
# Change the template
|
||||
from app.dao.templates_dao import (
|
||||
dao_get_template_by_id,
|
||||
dao_update_template,
|
||||
)
|
||||
from app.dao.templates_dao import dao_get_template_by_id, dao_update_template
|
||||
|
||||
sample_email_template.content = (
|
||||
sample_email_template.content + " another version of the template"
|
||||
|
||||
@@ -2,10 +2,7 @@ import pytest
|
||||
import requests
|
||||
import requests_mock
|
||||
|
||||
from app.clients.document_download import (
|
||||
DocumentDownloadClient,
|
||||
DocumentDownloadError,
|
||||
)
|
||||
from app.clients.document_download import DocumentDownloadClient, DocumentDownloadError
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
|
||||
@@ -4,12 +4,7 @@ from app.dao.service_permissions_dao import (
|
||||
dao_fetch_service_permissions,
|
||||
dao_remove_service_permission,
|
||||
)
|
||||
from app.models import (
|
||||
EMAIL_TYPE,
|
||||
INBOUND_SMS_TYPE,
|
||||
INTERNATIONAL_SMS_TYPE,
|
||||
SMS_TYPE,
|
||||
)
|
||||
from app.models import EMAIL_TYPE, INBOUND_SMS_TYPE, INTERNATIONAL_SMS_TYPE, SMS_TYPE
|
||||
from tests.app.db import create_service, create_service_permission
|
||||
|
||||
|
||||
|
||||
@@ -16,10 +16,7 @@ from app.dao.inbound_numbers_dao import (
|
||||
)
|
||||
from app.dao.organization_dao import dao_add_service_to_organization
|
||||
from app.dao.service_permissions_dao import dao_remove_service_permission
|
||||
from app.dao.service_user_dao import (
|
||||
dao_get_service_user,
|
||||
dao_update_service_user,
|
||||
)
|
||||
from app.dao.service_user_dao import dao_get_service_user, dao_update_service_user
|
||||
from app.dao.services_dao import (
|
||||
dao_add_user_to_service,
|
||||
dao_create_service,
|
||||
|
||||
@@ -7,10 +7,7 @@ from sqlalchemy.exc import DataError
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
|
||||
from app import db
|
||||
from app.dao.service_user_dao import (
|
||||
dao_get_service_user,
|
||||
dao_update_service_user,
|
||||
)
|
||||
from app.dao.service_user_dao import dao_get_service_user, dao_update_service_user
|
||||
from app.dao.users_dao import (
|
||||
_remove_values_for_keys_if_present,
|
||||
count_user_verify_codes,
|
||||
|
||||
@@ -193,10 +193,7 @@ def test_send_sms_should_use_template_version_from_notification_not_latest(
|
||||
expected_template_id = sample_template.id
|
||||
|
||||
# Change the template
|
||||
from app.dao.templates_dao import (
|
||||
dao_get_template_by_id,
|
||||
dao_update_template,
|
||||
)
|
||||
from app.dao.templates_dao import dao_get_template_by_id, dao_update_template
|
||||
|
||||
sample_template.content = (
|
||||
sample_template.content + " another version of the template"
|
||||
|
||||
@@ -6,9 +6,7 @@ from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
import app
|
||||
from app.dao import templates_dao
|
||||
from app.models import EMAIL_TYPE, SMS_TYPE
|
||||
from app.notifications.process_notifications import (
|
||||
create_content_for_notification,
|
||||
)
|
||||
from app.notifications.process_notifications import create_content_for_notification
|
||||
from app.notifications.sns_cert_validator import (
|
||||
VALID_SNS_TOPICS,
|
||||
get_string_to_sign,
|
||||
|
||||
@@ -5,9 +5,7 @@ from freezegun import freeze_time
|
||||
|
||||
from app.errors import InvalidRequest
|
||||
from app.models import EMAIL_TYPE, SMS_TYPE
|
||||
from app.platform_stats.rest import (
|
||||
validate_date_range_is_within_a_financial_year,
|
||||
)
|
||||
from app.platform_stats.rest import validate_date_range_is_within_a_financial_year
|
||||
from tests.app.db import (
|
||||
create_ft_billing,
|
||||
create_ft_notification_status,
|
||||
|
||||
@@ -11,10 +11,7 @@ import app
|
||||
from app.dao import notifications_dao
|
||||
from app.dao.api_key_dao import save_model_api_key
|
||||
from app.dao.services_dao import dao_update_service
|
||||
from app.dao.templates_dao import (
|
||||
dao_get_all_templates_for_service,
|
||||
dao_update_template,
|
||||
)
|
||||
from app.dao.templates_dao import dao_get_all_templates_for_service, dao_update_template
|
||||
from app.errors import InvalidRequest
|
||||
from app.models import (
|
||||
EMAIL_TYPE,
|
||||
|
||||
@@ -6,9 +6,7 @@ from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
from notifications_utils.recipients import InvalidPhoneError
|
||||
|
||||
from app.config import QueueNames
|
||||
from app.dao.service_guest_list_dao import (
|
||||
dao_add_and_commit_guest_list_contacts,
|
||||
)
|
||||
from app.dao.service_guest_list_dao import dao_add_and_commit_guest_list_contacts
|
||||
from app.models import (
|
||||
EMAIL_TYPE,
|
||||
KEY_TYPE_NORMAL,
|
||||
|
||||
@@ -11,10 +11,7 @@ from sqlalchemy.exc import SQLAlchemyError
|
||||
from app.dao.organization_dao import dao_add_service_to_organization
|
||||
from app.dao.service_sms_sender_dao import dao_get_sms_senders_by_service_id
|
||||
from app.dao.service_user_dao import dao_get_service_user
|
||||
from app.dao.services_dao import (
|
||||
dao_add_user_to_service,
|
||||
dao_remove_user_from_service,
|
||||
)
|
||||
from app.dao.services_dao import dao_add_user_to_service, dao_remove_user_from_service
|
||||
from app.dao.templates_dao import dao_redact_template
|
||||
from app.dao.users_dao import save_model_user
|
||||
from app.models import (
|
||||
|
||||
@@ -5,9 +5,7 @@ import pytest
|
||||
from jsonschema import ValidationError
|
||||
|
||||
from app.schema_validation import validate
|
||||
from app.service.service_callback_api_schema import (
|
||||
update_service_callback_api_schema,
|
||||
)
|
||||
from app.service.service_callback_api_schema import update_service_callback_api_schema
|
||||
|
||||
|
||||
def test_service_callback_api_schema_validates():
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import json
|
||||
import uuid
|
||||
|
||||
from app.dao.service_guest_list_dao import (
|
||||
dao_add_and_commit_guest_list_contacts,
|
||||
)
|
||||
from app.dao.service_guest_list_dao import dao_add_and_commit_guest_list_contacts
|
||||
from app.models import EMAIL_TYPE, MOBILE_TYPE, ServiceGuestList
|
||||
from tests import create_admin_authorization_header
|
||||
|
||||
|
||||
@@ -8,10 +8,7 @@ from flask import current_app
|
||||
from freezegun import freeze_time
|
||||
|
||||
from app.dao.permissions_dao import default_service_permissions
|
||||
from app.dao.service_user_dao import (
|
||||
dao_get_service_user,
|
||||
dao_update_service_user,
|
||||
)
|
||||
from app.dao.service_user_dao import dao_get_service_user, dao_update_service_user
|
||||
from app.models import (
|
||||
EMAIL_AUTH_TYPE,
|
||||
MANAGE_SETTINGS,
|
||||
|
||||
Reference in New Issue
Block a user