mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-02 20:59:39 -04:00
Localise and simplify fixture to invite tests
This isn't used anywhere else.
This commit is contained in:
@@ -25,6 +25,11 @@ def mock_get_existing_user_by_email(mocker, api_user_active):
|
||||
return mocker.patch('app.user_api_client.get_user_by_email', return_value=api_user_active)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_check_invite_token(mocker, sample_invite):
|
||||
return mocker.patch('app.invite_api_client.check_token', return_value=sample_invite)
|
||||
|
||||
|
||||
def test_existing_user_accept_invite_calls_api_and_redirects_to_dashboard(
|
||||
client,
|
||||
service_one,
|
||||
|
||||
@@ -2482,14 +2482,6 @@ def mock_get_invites_without_manage_permission(mocker, service_one, sample_invit
|
||||
return mocker.patch('app.models.user.InvitedUsers.client_method', side_effect=_get_invites)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_check_invite_token(mocker, sample_invite):
|
||||
def _check_token(token):
|
||||
return sample_invite
|
||||
|
||||
return mocker.patch('app.invite_api_client.check_token', side_effect=_check_token)
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_accept_invite(mocker, sample_invite):
|
||||
def _accept(service_id, invite_id):
|
||||
|
||||
Reference in New Issue
Block a user