diff --git a/tests/app/main/views/test_find_users.py b/tests/app/main/views/test_find_users.py index 7e8fce81a..1378a677c 100644 --- a/tests/app/main/views/test_find_users.py +++ b/tests/app/main/views/test_find_users.py @@ -255,20 +255,15 @@ def test_archive_user_shows_error_message_if_user_cannot_be_archived( ) == 'User can’t be removed from a service - check all services have another team member with manage_settings' -def test_archive_user_does_not_create_event_if_user_client_raises_exception( +def test_archive_user_does_not_create_event_if_user_client_raises_unexpected_exception( platform_admin_client, api_user_active, mocker, mock_events, ): - mock_user_client = mocker.patch('app.user_api_client.post', side_effect=Exception()) - with pytest.raises(Exception): - response = platform_admin_client.post( + platform_admin_client.post( url_for('main.archive_user', user_id=api_user_active.id) ) - assert response.status_code == 500 - assert response.location == url_for('main.user_information', user_id=api_user_active['id'], _external=True) - mock_user_client.assert_called_once_with('/user/{}/archive'.format(api_user_active['id']), data=None) - assert not mock_events.called + assert not mock_events.called