mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 05:59:44 -04:00
Merge pull request #3254 from alphagov/letter-validation-short-messages
Add separate messages for precompiled letters that have failed validation
This commit is contained in:
@@ -254,3 +254,26 @@ def test_letter_template_preview_headers(
|
||||
)
|
||||
|
||||
assert response.headers.get('X-Frame-Options') == 'SAMEORIGIN'
|
||||
|
||||
|
||||
def test_letter_spec_redirect(client_request):
|
||||
client_request.get(
|
||||
'main.letter_spec',
|
||||
_expected_status=302,
|
||||
_expected_redirect=(
|
||||
'https://docs.notifications.service.gov.uk'
|
||||
'/documentation/images/notify-pdf-letter-spec-v2.4.pdf'
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def test_letter_spec_redirect_with_non_logged_in_user(client_request):
|
||||
client_request.logout()
|
||||
client_request.get(
|
||||
'main.letter_spec',
|
||||
_expected_status=302,
|
||||
_expected_redirect=(
|
||||
'https://docs.notifications.service.gov.uk'
|
||||
'/documentation/images/notify-pdf-letter-spec-v2.4.pdf'
|
||||
),
|
||||
)
|
||||
|
||||
@@ -331,9 +331,10 @@ def test_notification_page_shows_validation_failed_precompiled_letter(
|
||||
)
|
||||
|
||||
error_message = page.find('p', class_='notification-status-cancelled').text
|
||||
assert normalize_spaces(error_message) == \
|
||||
"Validation failed – Your content is outside the printable area. " \
|
||||
"You need to edit page 1.Files must meet our letter specification."
|
||||
assert normalize_spaces(error_message) == (
|
||||
'Validation failed because content is outside the printable area on page 1.'
|
||||
'Files must meet our letter specification.'
|
||||
)
|
||||
|
||||
assert not page.select('p.notification-status')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user