Make sure caseworking users clear their invite

There was a bug where caseworking users skipped the part of the invite
flow where their invite was cleared from the session. This caused
a 500 if they later tried to create another service.

This commit makes sure that both types of user have the invite cleared
from the session after accepting it.
This commit is contained in:
Chris Hill-Scott
2018-07-05 11:45:09 +01:00
parent 9da9e85293
commit b21c0da683
4 changed files with 98 additions and 9 deletions

View File

@@ -3,12 +3,11 @@ import functools
import pytest
from flask import url_for
from tests.conftest import client_request as client_request_factory
@pytest.fixture
def get_service_settings_page(
logged_in_platform_admin_client,
client_request,
platform_admin_user,
service_one,
mock_get_inbound_number_for_service,
mock_get_letter_email_branding,
@@ -18,8 +17,8 @@ def get_service_settings_page(
no_letter_contact_blocks,
single_sms_sender,
):
platform_admin_request = client_request_factory(logged_in_platform_admin_client)
return functools.partial(platform_admin_request.get, 'main.service_settings', service_id=service_one['id'])
client_request.login(platform_admin_user)
return functools.partial(client_request.get, 'main.service_settings', service_id=service_one['id'])
@pytest.mark.parametrize('service_fields, endpoint, kwargs, text', [