mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
change error message for not selecting a template
needed to subclass RadioField for this
This commit is contained in:
@@ -1092,3 +1092,27 @@ def test_should_be_able_to_move_to_new_folder(
|
||||
folder_ids={FOLDER_TWO_ID},
|
||||
template_ids={TEMPLATE_ONE_ID},
|
||||
)
|
||||
|
||||
|
||||
def test_radio_button_with_no_value_shows_custom_error_message(
|
||||
client_request,
|
||||
service_one,
|
||||
mock_get_service_templates,
|
||||
mock_get_template_folders,
|
||||
mock_move_to_template_folder,
|
||||
mock_create_template_folder,
|
||||
):
|
||||
service_one['permissions'] += ['edit_folders']
|
||||
|
||||
page = client_request.post(
|
||||
'main.choose_template',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
_data={'operation': 'add-new-template'},
|
||||
_expected_status=200,
|
||||
_expected_redirect=None,
|
||||
)
|
||||
|
||||
assert mock_move_to_template_folder.called is False
|
||||
assert mock_create_template_folder.called is False
|
||||
|
||||
assert page.select_one('span.error-message').text.strip() == 'Select the type of template you want to add'
|
||||
|
||||
Reference in New Issue
Block a user