Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bolyachevets committed Jan 9, 2024
1 parent e1852eb commit dec6d25
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion auth-api/src/auth_api/services/rest_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def get(endpoint, token=None, # pylint: disable=too-many-arguments
return response

@staticmethod
@cache.cached()
@cache.cached(query_string=True)
def get_service_account_token(config_id='KEYCLOAK_SERVICE_ACCOUNT_ID',
config_secret='KEYCLOAK_SERVICE_ACCOUNT_SECRET') -> str:
"""Generate a service account token."""
Expand Down
8 changes: 4 additions & 4 deletions auth-api/tests/unit/api/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_fetch_tasks_end_of_day(client, jwt, session):
assert rv.status_code == http_status.HTTP_200_OK


def test_put_task_org(client, jwt, session, keycloak_mock, monkeypatch): # pylint:disable=unused-argument
def test_put_task_org(app, client, jwt, session, keycloak_mock, monkeypatch): # pylint:disable=unused-argument
"""Assert that the task can be updated."""
# 1. Create User
# 2. Get document signed link
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_put_task_org(client, jwt, session, keycloak_mock, monkeypatch): # pyli
assert rv.json.get('orgStatus') == OrgStatus.ACTIVE.value


def test_put_task_org_on_hold(client, jwt, session, keycloak_mock, monkeypatch): # pylint:disable=unused-argument
def test_put_task_org_on_hold(app, client, jwt, session, keycloak_mock, monkeypatch): # pylint:disable=unused-argument
"""Assert that the task can be updated."""
# 1. Create User
# 2. Get document signed link
Expand Down Expand Up @@ -244,7 +244,7 @@ def test_put_task_org_on_hold(client, jwt, session, keycloak_mock, monkeypatch):
assert rv.json.get('orgStatus') == OrgStatus.PENDING_STAFF_REVIEW.value


def test_put_task_product(client, jwt, session, keycloak_mock, monkeypatch): # pylint:disable=unused-argument
def test_put_task_product(app, client, jwt, session, keycloak_mock, monkeypatch): # pylint:disable=unused-argument
"""Assert that the task can be updated."""
# 1. Create User
# 4. Create Product subscription
Expand Down Expand Up @@ -344,7 +344,7 @@ def test_fetch_task(client, jwt, session): # pylint:disable=unused-argument
(TestJwtClaims.public_bceid_user, AccessType.GOVN.value, TaskAction.AFFIDAVIT_REVIEW.value),
(TestJwtClaims.public_user_role, AccessType.GOVN.value, TaskAction.ACCOUNT_REVIEW.value),
])
def test_tasks_on_account_creation(client, jwt, session, keycloak_mock, # pylint:disable=unused-argument
def test_tasks_on_account_creation(app, client, jwt, session, keycloak_mock, # pylint:disable=unused-argument
monkeypatch, user_token, access_type, expected_task_action):
"""Assert that tasks are created."""
# 1. Create User
Expand Down
6 changes: 3 additions & 3 deletions auth-api/tests/unit/api/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_add_user(client, jwt, session): # pylint:disable=unused-argument
assert schema_utils.validate(rv.json, 'user_response')[0]


def test_add_user_staff_org(client, jwt, session, keycloak_mock, monkeypatch):
def test_add_user_staff_org(app, client, jwt, session, keycloak_mock, monkeypatch):
"""Assert that adding and removing membership to a staff org occurs."""
# Create a user and org
user_model = factory_user_model(user_info=TestUserInfo.user_test)
Expand Down Expand Up @@ -686,7 +686,7 @@ def test_delete_unknown_user_returns_404(client, jwt, session): # pylint:disabl


@pytest.mark.parametrize('environment', ['test', None])
def test_delete_user_as_only_admin_returns_400(client, jwt, session, keycloak_mock,
def test_delete_user_as_only_admin_returns_400(app, client, jwt, session, keycloak_mock,
monkeypatch, environment): # pylint:disable=unused-argument
"""Test if the user is the only owner of a team assert status is 400."""
user_model = factory_user_model(user_info=TestUserInfo.user_test)
Expand Down Expand Up @@ -717,7 +717,7 @@ def test_delete_user_as_only_admin_returns_400(client, jwt, session, keycloak_mo


@pytest.mark.parametrize('environment', ['test', None])
def test_delete_user_is_member_returns_204(client, jwt, session, keycloak_mock,
def test_delete_user_is_member_returns_204(app, client, jwt, session, keycloak_mock,
monkeypatch, environment): # pylint:disable=unused-argument
"""Test if the user is the member of a team assert status is 204."""
user_model = factory_user_model(user_info=TestUserInfo.user_test)
Expand Down
2 changes: 1 addition & 1 deletion auth-api/tests/unit/api/test_user_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
factory_auth_header, factory_contact_model, factory_user_model, patch_token_info)


def test_get_user_settings(client, jwt, session, keycloak_mock, monkeypatch): # pylint:disable=unused-argument
def test_get_user_settings(app, client, jwt, session, keycloak_mock, monkeypatch): # pylint:disable=unused-argument
"""Assert that get works and adhere to schema."""
user_model = factory_user_model(user_info=TestUserInfo.user_test)
contact = factory_contact_model()
Expand Down

0 comments on commit dec6d25

Please sign in to comment.