mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 08:28:15 -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:
@@ -11,8 +11,8 @@ from PyPDF2.utils import PdfReadError
|
||||
|
||||
from tests.conftest import (
|
||||
SERVICE_ONE_ID,
|
||||
active_caseworking_user,
|
||||
active_user_with_permissions,
|
||||
create_active_caseworking_user,
|
||||
create_active_user_with_permissions,
|
||||
mock_get_notification,
|
||||
normalize_spaces,
|
||||
)
|
||||
@@ -33,8 +33,8 @@ from tests.conftest import (
|
||||
('test', 'permanent-failure', 'Phone number does not exist (test)'),
|
||||
])
|
||||
@pytest.mark.parametrize('user', [
|
||||
active_user_with_permissions,
|
||||
active_caseworking_user,
|
||||
create_active_user_with_permissions(),
|
||||
create_active_caseworking_user(),
|
||||
])
|
||||
@freeze_time("2016-01-01 11:09:00.061258")
|
||||
def test_notification_status_page_shows_details(
|
||||
@@ -49,7 +49,7 @@ def test_notification_status_page_shows_details(
|
||||
expected_status,
|
||||
):
|
||||
|
||||
mocker.patch('app.user_api_client.get_user', return_value=user(fake_uuid))
|
||||
mocker.patch('app.user_api_client.get_user', return_value=user)
|
||||
|
||||
_mock_get_notification = mock_get_notification(
|
||||
mocker,
|
||||
|
||||
Reference in New Issue
Block a user