Delete caches when user accepts invite

Accepting an invite changes:
- the `user_to_service` list of users returned by `GET /service/<id>`
- the `services` list return by `GET /user/<id>`

The latter change is causing the functional tests to fail.
This commit is contained in:
Chris Hill-Scott
2018-04-19 13:15:52 +01:00
parent b849e214fd
commit 9a3f9b7273
3 changed files with 7 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ from unittest.mock import call
import pytest
from tests.conftest import SERVICE_ONE_ID, api_user_pending, fake_uuid
from app import service_api_client, user_api_client
from app import invite_api_client, service_api_client, user_api_client
from app.notify_client.models import User
user_id = fake_uuid()
@@ -248,6 +248,7 @@ def test_returns_value_from_cache(
(user_api_client, 'set_user_permissions', [user_id, SERVICE_ONE_ID, []], {}),
(user_api_client, 'activate_user', [api_user_pending(fake_uuid())], {}),
(service_api_client, 'remove_user_from_service', [SERVICE_ONE_ID, user_id], {}),
(invite_api_client, 'accept_invite', [SERVICE_ONE_ID, user_id], {}),
])
def test_deletes_user_cache(
app_,