fix pete's broken tests

This commit is contained in:
Leo Hemsted
2018-06-15 16:27:17 +01:00
parent 81de3701b5
commit ad8e95302c
2 changed files with 14 additions and 14 deletions
+7 -7
View File
@@ -124,7 +124,7 @@ def test_get_feedback_page_with_prefilled_body(
_data={'feedback': 'blah', 'name': 'Example', 'email_address': 'test@example.com'} _data={'feedback': 'blah', 'name': 'Example', 'email_address': 'test@example.com'}
) )
message = mock_post.call_args[1]['message'] message = mock_post.call_args[1]['message']
assert message.endswith('blah') assert message.startswith('blah')
assert 'Please send' not in message assert 'Please send' not in message
@@ -144,7 +144,7 @@ def test_passed_non_logged_in_user_details_through_flow(client, mocker, ticket_t
assert resp.location == url_for('main.thanks', urgent=True, anonymous=False, _external=True) assert resp.location == url_for('main.thanks', urgent=True, anonymous=False, _external=True)
mock_post.assert_called_with( mock_post.assert_called_with(
subject='Notify feedback', subject='Notify feedback',
message='Environment: http://localhost/\n\nblah', message='blah\n',
user_email='rip@gmail.com', user_email='rip@gmail.com',
user_name='Steve Irwin', user_name='Steve Irwin',
ticket_type=ticket_type, ticket_type=ticket_type,
@@ -182,14 +182,14 @@ def test_passes_user_details_through_flow(
p1=ANY p1=ANY
) )
assert mock_post.call_args[1]['message'] == '\n'.join([ assert mock_post.call_args[1]['message'] == '\n'.join([
'Environment: http://localhost/', 'blah',
'Service "service one": {}'.format(url_for( 'Service: "service one"',
url_for(
'main.service_dashboard', 'main.service_dashboard',
service_id='596364a0-858e-42c8-9062-a8fe822260eb', service_id='596364a0-858e-42c8-9062-a8fe822260eb',
_external=True _external=True
)), ),
'', ''
'blah',
]) ])
@@ -595,7 +595,7 @@ def test_should_redirect_after_request_to_go_live(
) )
returned_message = mock_post.call_args[1]['message'] returned_message = mock_post.call_args[1]['message']
assert 'On behalf of service one' in returned_message assert 'Service: service one' in returned_message
assert 'Organisation type: central' in returned_message assert 'Organisation type: central' in returned_message
assert 'Agreement signed: Cant tell' in returned_message assert 'Agreement signed: Cant tell' in returned_message
assert 'Channel: email and text messages' in returned_message assert 'Channel: email and text messages' in returned_message
@@ -2610,13 +2610,13 @@ def test_submit_email_branding_request(
) )
zendesk.assert_called_once_with( zendesk.assert_called_once_with(
message=( message='\n'.join([
'On behalf of service one ' 'Service: service one',
'(http://localhost/services/596364a0-858e-42c8-9062-a8fe822260eb)\n' 'http://localhost/services/596364a0-858e-42c8-9062-a8fe822260eb',
'\n' '',
'---\n' '---',
'Branding requested: {}' 'Branding requested: {}'
).format(requested_branding), ]).format(requested_branding),
subject='Email branding request - service one', subject='Email branding request - service one',
ticket_type='question', ticket_type='question',
user_email='test@user.gov.uk', user_email='test@user.gov.uk',