mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-26 01:03:41 -04:00
try deactivating some letter routes
This commit is contained in:
@@ -2510,40 +2510,6 @@ def test_create_pdf_letter(mocker, sample_service_full_permissions, client, fake
|
||||
assert json_resp == {'id': fake_uuid}
|
||||
|
||||
|
||||
@pytest.mark.parametrize('post_data, expected_errors', [
|
||||
(
|
||||
{},
|
||||
[
|
||||
{'error': 'ValidationError', 'message': 'postage is a required property'},
|
||||
{'error': 'ValidationError', 'message': 'filename is a required property'},
|
||||
{'error': 'ValidationError', 'message': 'created_by is a required property'},
|
||||
{'error': 'ValidationError', 'message': 'file_id is a required property'},
|
||||
{'error': 'ValidationError', 'message': 'recipient_address is a required property'}
|
||||
]
|
||||
),
|
||||
(
|
||||
{"postage": "third", "filename": "string", "created_by": "string", "file_id": "string",
|
||||
"recipient_address": "Some Address"},
|
||||
[
|
||||
{'error': 'ValidationError',
|
||||
'message': 'postage invalid. It must be first, second, europe or rest-of-world.'}
|
||||
]
|
||||
)
|
||||
])
|
||||
def test_create_pdf_letter_validates_against_json_schema(
|
||||
sample_service_full_permissions, client, post_data, expected_errors
|
||||
):
|
||||
response = client.post(
|
||||
url_for('service.create_pdf_letter', service_id=sample_service_full_permissions.id),
|
||||
data=json.dumps(post_data),
|
||||
headers=[('Content-Type', 'application/json'), create_admin_authorization_header()]
|
||||
)
|
||||
json_resp = json.loads(response.get_data(as_text=True))
|
||||
|
||||
assert response.status_code == 400
|
||||
assert json_resp['errors'] == expected_errors
|
||||
|
||||
|
||||
def test_get_notification_for_service_includes_template_redacted(admin_request, sample_notification):
|
||||
resp = admin_request.get(
|
||||
'service.get_notification_for_service',
|
||||
@@ -2555,17 +2521,6 @@ def test_get_notification_for_service_includes_template_redacted(admin_request,
|
||||
assert resp['template']['redact_personalisation'] is False
|
||||
|
||||
|
||||
def test_get_notification_for_service_includes_precompiled_letter(admin_request, sample_notification):
|
||||
resp = admin_request.get(
|
||||
'service.get_notification_for_service',
|
||||
service_id=sample_notification.service_id,
|
||||
notification_id=sample_notification.id
|
||||
)
|
||||
|
||||
assert resp['id'] == str(sample_notification.id)
|
||||
assert resp['template']['is_precompiled_letter'] is False
|
||||
|
||||
|
||||
def test_get_all_notifications_for_service_includes_template_redacted(admin_request, sample_service):
|
||||
normal_template = create_template(sample_service)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user