mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 06:38:26 -04:00
Merge pull request #3790 from alphagov/show-from-reply-to
Fix not showing 'From' / 'Reply to' after sending
This commit is contained in:
@@ -949,3 +949,22 @@ def test_cancelling_a_letter_calls_the_api(
|
||||
)
|
||||
|
||||
assert cancel_endpoint.called
|
||||
|
||||
|
||||
@pytest.mark.parametrize('notification_type', ['sms', 'email'])
|
||||
def test_should_show_reply_to_from_notification(
|
||||
mocker,
|
||||
fake_uuid,
|
||||
notification_type,
|
||||
client_request,
|
||||
):
|
||||
notification = create_notification(reply_to_text='reply to info', template_type=notification_type)
|
||||
mocker.patch('app.notification_api_client.get_notification', return_value=notification)
|
||||
|
||||
page = client_request.get(
|
||||
'main.view_notification',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
notification_id=fake_uuid,
|
||||
)
|
||||
|
||||
assert 'reply to info' in page.text
|
||||
|
||||
@@ -254,6 +254,52 @@ def test_set_sender_redirects_if_no_sms_senders(
|
||||
)
|
||||
|
||||
|
||||
def test_set_sender_redirects_if_one_email_sender(
|
||||
client_request,
|
||||
fake_uuid,
|
||||
mock_get_service_email_template,
|
||||
single_reply_to_email_address,
|
||||
):
|
||||
client_request.get(
|
||||
'.set_sender',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id=fake_uuid,
|
||||
_expected_status=302,
|
||||
_expected_url=url_for(
|
||||
'.send_one_off',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id=fake_uuid,
|
||||
_external=True,
|
||||
)
|
||||
)
|
||||
|
||||
with client_request.session_transaction() as session:
|
||||
assert session['sender_id'] == '1234'
|
||||
|
||||
|
||||
def test_set_sender_redirects_if_one_sms_sender(
|
||||
client_request,
|
||||
fake_uuid,
|
||||
mock_get_service_template,
|
||||
single_sms_sender,
|
||||
):
|
||||
client_request.get(
|
||||
'.set_sender',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id=fake_uuid,
|
||||
_expected_status=302,
|
||||
_expected_url=url_for(
|
||||
'.send_one_off',
|
||||
service_id=SERVICE_ONE_ID,
|
||||
template_id=fake_uuid,
|
||||
_external=True,
|
||||
)
|
||||
)
|
||||
|
||||
with client_request.session_transaction() as session:
|
||||
assert session['sender_id'] == '1234'
|
||||
|
||||
|
||||
def test_that_test_files_exist():
|
||||
assert len(test_spreadsheet_files) == 8
|
||||
assert len(test_non_spreadsheet_files) == 6
|
||||
|
||||
Reference in New Issue
Block a user