mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-13 01:44:08 -04:00
Remove prefilled message thing
This commit is contained in:
@@ -20,20 +20,6 @@ from app.models.feedback import (
|
||||
)
|
||||
|
||||
|
||||
def get_prefilled_message():
|
||||
return {
|
||||
'agreement': (
|
||||
'Please can you tell me if there’s an agreement in place '
|
||||
'between GOV.UK Notify and my organisation?'
|
||||
),
|
||||
'letter-branding': (
|
||||
'I would like my own logo on my letter templates.'
|
||||
),
|
||||
}.get(
|
||||
request.args.get('body'), ''
|
||||
)
|
||||
|
||||
|
||||
@main.route('/support', methods=['GET', 'POST'])
|
||||
def support():
|
||||
|
||||
@@ -147,9 +133,6 @@ def feedback(ticket_type):
|
||||
),
|
||||
))
|
||||
|
||||
if not form.feedback.data:
|
||||
form.feedback.data = get_prefilled_message()
|
||||
|
||||
return render_template(
|
||||
'views/support/form.html',
|
||||
form=form,
|
||||
|
||||
@@ -134,50 +134,6 @@ def test_get_feedback_page(client, ticket_type, expected_status_code):
|
||||
assert response.status_code == expected_status_code
|
||||
|
||||
|
||||
@pytest.mark.parametrize('prefilled_body, expected_textarea', [
|
||||
(
|
||||
'agreement',
|
||||
(
|
||||
'Please can you tell me if there’s an agreement in place '
|
||||
'between GOV.UK Notify and my organisation?'
|
||||
)
|
||||
),
|
||||
(
|
||||
'foo',
|
||||
''
|
||||
),
|
||||
])
|
||||
@freeze_time('2016-12-12 12:00:00.000000')
|
||||
def test_get_feedback_page_with_prefilled_body(
|
||||
client_request,
|
||||
mocker,
|
||||
fake_uuid,
|
||||
prefilled_body,
|
||||
expected_textarea,
|
||||
active_user_with_permissions,
|
||||
):
|
||||
active_user_with_permissions['email_address'] = 'test@marinemanagement.org.uk'
|
||||
mocker.patch('app.user_api_client.get_user', return_value=active_user_with_permissions)
|
||||
mock_post = mocker.patch('app.main.views.feedback.zendesk_client.create_ticket')
|
||||
page = client_request.get(
|
||||
'main.feedback',
|
||||
ticket_type=QUESTION_TICKET_TYPE,
|
||||
body=prefilled_body,
|
||||
)
|
||||
assert page.select_one('textarea').text == (
|
||||
expected_textarea
|
||||
)
|
||||
client_request.post(
|
||||
'main.feedback',
|
||||
ticket_type=QUESTION_TICKET_TYPE,
|
||||
body='agreement',
|
||||
_data={'feedback': 'blah', 'name': 'Example', 'email_address': 'test@example.com'}
|
||||
)
|
||||
message = mock_post.call_args[1]['message']
|
||||
assert message.startswith('blah')
|
||||
assert 'Please send' not in message
|
||||
|
||||
|
||||
@freeze_time('2016-12-12 12:00:00.000000')
|
||||
@pytest.mark.parametrize('ticket_type', [PROBLEM_TICKET_TYPE, QUESTION_TICKET_TYPE])
|
||||
def test_passed_non_logged_in_user_details_through_flow(client, mocker, ticket_type):
|
||||
|
||||
Reference in New Issue
Block a user