mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
test cleaning for the current state of things
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from botocore.exceptions import ClientError
|
||||
from flask import current_app
|
||||
from notifications_utils.international_billing_rates import (
|
||||
INTERNATIONAL_BILLING_RATES,
|
||||
@@ -20,7 +19,6 @@ from werkzeug.datastructures import MultiDict
|
||||
|
||||
from app import create_uuid, db
|
||||
from app.dao.dao_utils import autocommit
|
||||
from app.letters.utils import LetterPDFNotFound, find_letter_pdf_in_s3
|
||||
from app.models import (
|
||||
EMAIL_TYPE,
|
||||
KEY_TYPE_NORMAL,
|
||||
@@ -32,7 +30,6 @@ from app.models import (
|
||||
NOTIFICATION_PERMANENT_FAILURE,
|
||||
NOTIFICATION_SENDING,
|
||||
NOTIFICATION_SENT,
|
||||
NOTIFICATION_STATUS_TYPES_COMPLETED,
|
||||
NOTIFICATION_TEMPORARY_FAILURE,
|
||||
SMS_TYPE,
|
||||
FactNotificationStatus,
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from flask import current_app
|
||||
from sqlalchemy import asc, desc
|
||||
|
||||
from app import db
|
||||
from app.dao.dao_utils import VersionOptions, autocommit, version_class
|
||||
from app.dao.users_dao import get_user_by_id
|
||||
from app.models import (
|
||||
LETTER_TYPE,
|
||||
SECOND_CLASS,
|
||||
Template,
|
||||
TemplateHistory,
|
||||
TemplateRedacted,
|
||||
)
|
||||
from app.models import Template, TemplateHistory, TemplateRedacted
|
||||
|
||||
|
||||
@autocommit
|
||||
|
||||
+1
-4
@@ -1,8 +1,5 @@
|
||||
from flask import Blueprint, jsonify, request
|
||||
from flask import Blueprint
|
||||
|
||||
from app.config import QueueNames
|
||||
from app.letters.letter_schemas import letter_references
|
||||
from app.schema_validation import validate
|
||||
from app.v2.errors import register_errors
|
||||
|
||||
letter_job = Blueprint("letter-job", __name__)
|
||||
|
||||
@@ -123,7 +123,6 @@ from app.schemas import (
|
||||
)
|
||||
from app.service import statistics
|
||||
from app.service.send_notification import send_one_off_notification
|
||||
from app.service.send_pdf_letter_schema import send_pdf_letter_request
|
||||
from app.service.sender import send_notification_to_service_users
|
||||
from app.service.service_contact_list_schema import (
|
||||
create_service_contact_list_schema,
|
||||
|
||||
@@ -25,7 +25,6 @@ from app.models import (
|
||||
KEY_TYPE_NORMAL,
|
||||
KEY_TYPE_TEAM,
|
||||
KEY_TYPE_TEST,
|
||||
LETTER_TYPE,
|
||||
NOTIFICATION_CREATED,
|
||||
NOTIFICATION_DELIVERED,
|
||||
NOTIFICATION_PENDING_VIRUS_CHECK,
|
||||
@@ -59,12 +58,10 @@ from app.v2.errors import BadRequestError
|
||||
from app.v2.notifications import v2_notification_blueprint
|
||||
from app.v2.notifications.create_response import (
|
||||
create_post_email_response_from_notification,
|
||||
create_post_letter_response_from_notification,
|
||||
create_post_sms_response_from_notification,
|
||||
)
|
||||
from app.v2.notifications.notification_schemas import (
|
||||
post_email_request,
|
||||
post_letter_request,
|
||||
post_sms_request,
|
||||
)
|
||||
from app.v2.utils import get_valid_json
|
||||
@@ -136,7 +133,6 @@ def post_notification(notification_type):
|
||||
|
||||
reply_to = get_reply_to_text(notification_type, form, template)
|
||||
|
||||
|
||||
notification = process_sms_or_email_notification(
|
||||
form=form,
|
||||
notification_type=notification_type,
|
||||
|
||||
@@ -15,7 +15,7 @@ from app.celery.nightly_tasks import (
|
||||
save_daily_notification_processing_time,
|
||||
timeout_notifications,
|
||||
)
|
||||
from app.models import EMAIL_TYPE, LETTER_TYPE, SMS_TYPE, FactProcessingTime
|
||||
from app.models import EMAIL_TYPE, SMS_TYPE, FactProcessingTime
|
||||
from tests.app.db import (
|
||||
create_job,
|
||||
create_notification,
|
||||
|
||||
@@ -6,7 +6,6 @@ from flask import json
|
||||
|
||||
from app.celery.research_mode_tasks import (
|
||||
HTTPError,
|
||||
create_fake_letter_response_file,
|
||||
send_email_response,
|
||||
send_sms_response,
|
||||
ses_notification_callback,
|
||||
|
||||
@@ -44,8 +44,6 @@ from app.models import (
|
||||
SMS_TYPE,
|
||||
Job,
|
||||
Notification,
|
||||
NotificationHistory,
|
||||
ReturnedLetter,
|
||||
)
|
||||
from app.serialised_models import SerialisedService, SerialisedTemplate
|
||||
from app.utils import DATETIME_FORMAT
|
||||
@@ -57,7 +55,6 @@ from tests.app.db import (
|
||||
create_job,
|
||||
create_letter_contact,
|
||||
create_notification,
|
||||
create_notification_history,
|
||||
create_reply_to_email,
|
||||
create_service,
|
||||
create_service_inbound_api,
|
||||
|
||||
@@ -1,23 +1,14 @@
|
||||
import base64
|
||||
import json
|
||||
import random
|
||||
import string
|
||||
import uuid
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import botocore
|
||||
import pytest
|
||||
import requests_mock
|
||||
from freezegun import freeze_time
|
||||
from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
from PyPDF2.errors import PdfReadError
|
||||
|
||||
from app.dao.templates_dao import (
|
||||
dao_get_template_by_id,
|
||||
dao_get_template_versions,
|
||||
dao_redact_template,
|
||||
dao_update_template,
|
||||
)
|
||||
from app.dao.templates_dao import dao_get_template_by_id, dao_redact_template
|
||||
from app.models import (
|
||||
EMAIL_TYPE,
|
||||
LETTER_TYPE,
|
||||
@@ -28,12 +19,10 @@ from app.models import (
|
||||
from tests import create_admin_authorization_header
|
||||
from tests.app.db import (
|
||||
create_letter_contact,
|
||||
create_notification,
|
||||
create_service,
|
||||
create_template,
|
||||
create_template_folder,
|
||||
)
|
||||
from tests.conftest import set_config_values
|
||||
|
||||
|
||||
@pytest.mark.parametrize('template_type, subject', [
|
||||
|
||||
Reference in New Issue
Block a user