mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 23:28:25 -04:00
Reduce the errors related to user fixtures
We were using user fixtures in a lot of parameterized tests, but this is no longer allowed in Pytest 5. To avoid having to split up the parametrized tests (which would make the test files a lot longer and slightly more difficult to read) this commit creates functions which return various types of user json so that we can use these as the test parameters instead.
This commit is contained in:
@@ -9,8 +9,8 @@ import app
|
||||
from tests.conftest import (
|
||||
SERVICE_ONE_ID,
|
||||
USER_ONE_ID,
|
||||
active_caseworking_user,
|
||||
active_user_with_permissions,
|
||||
create_active_caseworking_user,
|
||||
create_active_user_with_permissions,
|
||||
normalize_spaces,
|
||||
)
|
||||
|
||||
@@ -126,8 +126,8 @@ def test_invite_goes_in_session(
|
||||
|
||||
|
||||
@pytest.mark.parametrize('user, landing_page_title', [
|
||||
(active_user_with_permissions, 'Dashboard'),
|
||||
(active_caseworking_user, 'Templates'),
|
||||
(create_active_user_with_permissions(), 'Dashboard'),
|
||||
(create_active_caseworking_user(), 'Templates'),
|
||||
])
|
||||
def test_accepting_invite_removes_invite_from_session(
|
||||
client_request,
|
||||
@@ -153,7 +153,6 @@ def test_accepting_invite_removes_invite_from_session(
|
||||
user,
|
||||
landing_page_title,
|
||||
):
|
||||
user = user(fake_uuid)
|
||||
sample_invite['email_address'] = user['email_address']
|
||||
|
||||
mocker.patch('app.invite_api_client.check_token', return_value=sample_invite)
|
||||
|
||||
Reference in New Issue
Block a user