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

@@ -2597,7 +2597,13 @@ def os_environ():
@pytest.fixture
def client_request(logged_in_client):
def client_request(
logged_in_client,
active_user_with_permissions,
mocker,
service_one,
fake_uuid,
):
class ClientRequest:
@staticmethod
@@ -2606,6 +2612,9 @@ def client_request(logged_in_client):
with logged_in_client.session_transaction() as session:
yield session
def login(user, service=service_one):
logged_in_client.login(user, mocker, service)
@staticmethod
def get(
endpoint,