mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 21:48:49 -04:00
more work on postage migration
This commit is contained in:
@@ -12,8 +12,6 @@ from app.dao.fact_billing_dao import (
|
||||
fetch_billing_totals_for_year,
|
||||
fetch_daily_sms_provider_volumes_for_platform,
|
||||
fetch_daily_volumes_for_platform,
|
||||
fetch_letter_costs_and_totals_for_all_services,
|
||||
fetch_letter_line_items_for_all_services,
|
||||
fetch_monthly_billing_for_year,
|
||||
fetch_sms_billing_for_all_services,
|
||||
fetch_sms_free_allowance_remainder_until_date,
|
||||
|
||||
@@ -29,7 +29,6 @@ from app.dao.users_dao import save_model_user
|
||||
from app.models import (
|
||||
EMAIL_TYPE,
|
||||
KEY_TYPE_NORMAL,
|
||||
LETTER_TYPE,
|
||||
MOBILE_TYPE,
|
||||
SMS_TYPE,
|
||||
AnnualBilling,
|
||||
|
||||
@@ -7,7 +7,7 @@ from notifications_utils import SMS_CHAR_COUNT_LIMIT
|
||||
|
||||
import app
|
||||
from app.dao import templates_dao
|
||||
from app.models import EMAIL_TYPE, INTERNATIONAL_LETTERS, LETTER_TYPE, SMS_TYPE
|
||||
from app.models import EMAIL_TYPE, LETTER_TYPE, SMS_TYPE
|
||||
from app.notifications.process_notifications import (
|
||||
create_content_for_notification,
|
||||
)
|
||||
|
||||
@@ -12,7 +12,6 @@ from app.dao.service_guest_list_dao import (
|
||||
from app.models import (
|
||||
EMAIL_TYPE,
|
||||
KEY_TYPE_NORMAL,
|
||||
LETTER_TYPE,
|
||||
MOBILE_TYPE,
|
||||
PRIORITY,
|
||||
SMS_TYPE,
|
||||
|
||||
@@ -21,7 +21,6 @@ from app.models import (
|
||||
)
|
||||
from tests.app.db import (
|
||||
create_inbound_number,
|
||||
create_letter_contact,
|
||||
create_notification,
|
||||
create_reply_to_email,
|
||||
create_service,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import datetime
|
||||
|
||||
import pytest
|
||||
from flask import json, url_for
|
||||
|
||||
|
||||
@@ -12,15 +12,12 @@ valid_version_params = [None, 1]
|
||||
@pytest.mark.parametrize("tmp_type, expected_name, expected_subject", [
|
||||
(SMS_TYPE, 'sms Template Name', None),
|
||||
(EMAIL_TYPE, 'email Template Name', 'Template subject'),
|
||||
(LETTER_TYPE, 'letter Template Name', 'Template subject')
|
||||
])
|
||||
@pytest.mark.parametrize("version", valid_version_params)
|
||||
def test_get_template_by_id_returns_200(
|
||||
client, sample_service, tmp_type, expected_name, expected_subject, version
|
||||
):
|
||||
letter_contact_block_id = None
|
||||
|
||||
template = create_template(sample_service, template_type=tmp_type, contact_block_id=(letter_contact_block_id))
|
||||
template = create_template(sample_service, template_type=tmp_type)
|
||||
auth_header = create_service_authorization_header(service_id=sample_service.id)
|
||||
|
||||
version_path = '/version/{}'.format(version) if version else ''
|
||||
@@ -44,7 +41,7 @@ def test_get_template_by_id_returns_200(
|
||||
"subject": expected_subject,
|
||||
'name': expected_name,
|
||||
'personalisation': {},
|
||||
'letter_contact_block': letter_contact_block.contact_block if letter_contact_block_id else None,
|
||||
'letter_contact_block': None,
|
||||
}
|
||||
|
||||
assert json_response == expected_response
|
||||
|
||||
Reference in New Issue
Block a user