From 51df90ac69ff4b7e7b12e31dce75be545d7c864a Mon Sep 17 00:00:00 2001 From: hagen-danswer Date: Sun, 1 Sep 2024 14:40:27 -0700 Subject: [PATCH] added api key manager --- .../common_utils/managers/api_key.py | 92 +++++++++++++++++++ .../common_utils/managers/document.py | 7 +- .../integration/common_utils/managers/user.py | 24 ----- .../common_utils/managers/user_group.py | 5 +- .../integration/common_utils/test_models.py | 13 +++ .../tests/connector/test_deletion.py | 22 +++-- .../tests/dev_apis/test_simple_chat_api.py | 12 ++- .../tests/document_set/test_syncing.py | 10 +- .../permissions/test_cc_pair_permissions.py | 42 ++++++--- .../permissions/test_connector_permissions.py | 20 ++-- .../test_credential_permissions.py | 17 ++-- .../permissions/test_doc_set_permissions.py | 24 +++-- .../permissions/test_user_role_permissions.py | 4 +- .../permissions/test_whole_curator_flow.py | 2 +- 14 files changed, 198 insertions(+), 96 deletions(-) create mode 100644 backend/tests/integration/common_utils/managers/api_key.py diff --git a/backend/tests/integration/common_utils/managers/api_key.py b/backend/tests/integration/common_utils/managers/api_key.py new file mode 100644 index 00000000000..b6d2c29b732 --- /dev/null +++ b/backend/tests/integration/common_utils/managers/api_key.py @@ -0,0 +1,92 @@ +from uuid import uuid4 + +import requests + +from danswer.db.models import UserRole +from ee.danswer.server.api_key.models import APIKeyArgs +from tests.integration.common_utils.constants import API_SERVER_URL +from tests.integration.common_utils.constants import GENERAL_HEADERS +from tests.integration.common_utils.test_models import TestAPIKey +from tests.integration.common_utils.test_models import TestUser + + +class APIKeyManager: + @staticmethod + def create( + name: str | None = None, + api_key_role: UserRole = UserRole.ADMIN, + user_performing_action: TestUser | None = None, + ) -> TestAPIKey: + name = f"{name}-api-key" if name else f"test-api-key-{uuid4()}" + api_key_request = APIKeyArgs( + name=name, + role=api_key_role, + ) + api_key_response = requests.post( + f"{API_SERVER_URL}/admin/api-key", + json=api_key_request.model_dump(), + headers=user_performing_action.headers + if user_performing_action + else GENERAL_HEADERS, + ) + api_key_response.raise_for_status() + api_key = api_key_response.json() + result_api_key = TestAPIKey( + api_key_id=api_key["api_key_id"], + api_key_display=api_key["api_key_display"], + api_key=api_key["api_key"], + api_key_name=name, + api_key_role=api_key_role, + user_id=api_key["user_id"], + headers=GENERAL_HEADERS, + ) + result_api_key.headers["Authorization"] = f"Bearer {result_api_key.api_key}" + return result_api_key + + @staticmethod + def delete( + api_key: TestAPIKey, + user_performing_action: TestUser | None = None, + ) -> None: + api_key_response = requests.delete( + f"{API_SERVER_URL}/admin/api-key/{api_key.api_key_id}", + headers=user_performing_action.headers + if user_performing_action + else GENERAL_HEADERS, + ) + api_key_response.raise_for_status() + + @staticmethod + def get_all( + user_performing_action: TestUser | None = None, + ) -> list[TestAPIKey]: + api_key_response = requests.get( + f"{API_SERVER_URL}/admin/api-key", + headers=user_performing_action.headers + if user_performing_action + else GENERAL_HEADERS, + ) + api_key_response.raise_for_status() + return [TestAPIKey(**api_key) for api_key in api_key_response.json()] + + @staticmethod + def verify( + api_key: TestAPIKey, + verify_deleted: bool = False, + user_performing_action: TestUser | None = None, + ) -> None: + retrieved_keys = APIKeyManager.get_all( + user_performing_action=user_performing_action + ) + for key in retrieved_keys: + if key.api_key_id == api_key.api_key_id: + if verify_deleted: + raise ValueError("API Key found when it should have been deleted") + if ( + key.api_key_name == api_key.api_key_name + and key.api_key_role == api_key.api_key_role + ): + return + + if not verify_deleted: + raise Exception("API Key not found") diff --git a/backend/tests/integration/common_utils/managers/document.py b/backend/tests/integration/common_utils/managers/document.py index 3fdf970bb64..3f691eca8f9 100644 --- a/backend/tests/integration/common_utils/managers/document.py +++ b/backend/tests/integration/common_utils/managers/document.py @@ -6,6 +6,7 @@ from tests.integration.common_utils.constants import API_SERVER_URL from tests.integration.common_utils.constants import GENERAL_HEADERS from tests.integration.common_utils.constants import NUM_DOCS +from tests.integration.common_utils.managers.api_key import TestAPIKey from tests.integration.common_utils.managers.cc_pair import TestCCPair from tests.integration.common_utils.test_models import SimpleTestDocument from tests.integration.common_utils.test_models import TestUser @@ -79,7 +80,7 @@ def seed_and_attach_docs( cc_pair: TestCCPair, num_docs: int = NUM_DOCS, document_ids: list[str] | None = None, - user_with_api_key: TestUser | None = None, + api_key: TestAPIKey | None = None, ) -> TestCCPair: # Use provided document_ids if available, otherwise generate random UUIDs if document_ids is None: @@ -94,9 +95,7 @@ def seed_and_attach_docs( response = requests.post( f"{API_SERVER_URL}/danswer-api/ingestion", json=document, - headers=user_with_api_key.headers - if user_with_api_key - else GENERAL_HEADERS, + headers=api_key.headers if api_key else GENERAL_HEADERS, ) response.raise_for_status() diff --git a/backend/tests/integration/common_utils/managers/user.py b/backend/tests/integration/common_utils/managers/user.py index 137f4f0b7a5..0946b8b1fca 100644 --- a/backend/tests/integration/common_utils/managers/user.py +++ b/backend/tests/integration/common_utils/managers/user.py @@ -8,7 +8,6 @@ from danswer.server.manage.models import AllUsersResponse from danswer.server.models import FullUserSnapshot from danswer.server.models import InvitedUserSnapshot -from ee.danswer.server.api_key.models import APIKeyArgs from tests.integration.common_utils.constants import API_SERVER_URL from tests.integration.common_utils.constants import GENERAL_HEADERS from tests.integration.common_utils.test_models import TestUser @@ -74,29 +73,6 @@ def login_as_user(test_user: TestUser) -> str: print(f"Logged in as {test_user.email}") return f"{result_cookie.name}={result_cookie.value}" - @staticmethod - def add_api_key_to_user( - user: TestUser, - name: str | None = None, - api_key_role: UserRole = UserRole.ADMIN, - user_performing_action: TestUser | None = None, - ) -> TestUser: - if user_performing_action is None: - user_performing_action = user - name = f"{name}-api-key" if name else f"test-api-key-{uuid4()}" - api_key_request = APIKeyArgs( - name=name, - role=api_key_role, - ) - api_key_response = requests.post( - f"{API_SERVER_URL}/admin/api-key", - json=api_key_request.model_dump(), - headers=user_performing_action.headers, - ) - api_key_response.raise_for_status() - user.headers["Authorization"] = f"Bearer {api_key_response.json()['api_key']}" - return user - @staticmethod def verify_role(user_to_verify: TestUser, target_role: UserRole) -> bool: response = requests.get( diff --git a/backend/tests/integration/common_utils/managers/user_group.py b/backend/tests/integration/common_utils/managers/user_group.py index cbf26b1e52e..5f5ac6b0e30 100644 --- a/backend/tests/integration/common_utils/managers/user_group.py +++ b/backend/tests/integration/common_utils/managers/user_group.py @@ -59,16 +59,17 @@ def edit( response.raise_for_status() @staticmethod - def set_user_to_curator( + def set_curator_status( test_user_group: TestUserGroup, user_to_set_as_curator: TestUser, + is_curator: bool = True, user_performing_action: TestUser | None = None, ) -> None: if not user_to_set_as_curator.id: raise ValueError("User has no ID") set_curator_request = { "user_id": user_to_set_as_curator.id, - "is_curator": True, + "is_curator": is_curator, } response = requests.post( f"{API_SERVER_URL}/manage/admin/user-group/{test_user_group.id}/set-curator", diff --git a/backend/tests/integration/common_utils/test_models.py b/backend/tests/integration/common_utils/test_models.py index c004381b58c..04db0851e3d 100644 --- a/backend/tests/integration/common_utils/test_models.py +++ b/backend/tests/integration/common_utils/test_models.py @@ -1,8 +1,10 @@ from typing import Any +from uuid import UUID from pydantic import BaseModel from pydantic import Field +from danswer.auth.schemas import UserRole from danswer.search.enums import RecencyBiasSetting from danswer.server.documents.models import DocumentSource from danswer.server.documents.models import InputType @@ -17,6 +19,17 @@ """ +class TestAPIKey(BaseModel): + api_key_id: int + api_key_display: str + api_key: str | None = None # only present on initial creation + api_key_name: str | None = None + api_key_role: UserRole + + user_id: UUID + headers: dict + + class TestUser(BaseModel): id: str email: str diff --git a/backend/tests/integration/tests/connector/test_deletion.py b/backend/tests/integration/tests/connector/test_deletion.py index 5ec4480a27c..a7708a02418 100644 --- a/backend/tests/integration/tests/connector/test_deletion.py +++ b/backend/tests/integration/tests/connector/test_deletion.py @@ -9,13 +9,15 @@ from danswer.server.documents.models import DocumentSource from tests.integration.common_utils.constants import NUM_DOCS +from tests.integration.common_utils.managers.api_key import APIKeyManager from tests.integration.common_utils.managers.cc_pair import CCPairManager from tests.integration.common_utils.managers.document import DocumentManager from tests.integration.common_utils.managers.document_set import DocumentSetManager -from tests.integration.common_utils.managers.user import TestUser from tests.integration.common_utils.managers.user import UserManager -from tests.integration.common_utils.managers.user_group import TestUserGroup from tests.integration.common_utils.managers.user_group import UserGroupManager +from tests.integration.common_utils.test_models import TestAPIKey +from tests.integration.common_utils.test_models import TestUser +from tests.integration.common_utils.test_models import TestUserGroup from tests.integration.common_utils.vespa import TestVespaClient @@ -23,8 +25,8 @@ def test_connector_deletion(reset: None, vespa_client: TestVespaClient) -> None: # Creating an admin user (first user created is automatically an admin) admin_user: TestUser = UserManager.create(name="admin_user") # add api key to user - admin_user = UserManager.add_api_key_to_user( - user=admin_user, + api_key: TestAPIKey = APIKeyManager.create( + user_performing_action=admin_user, ) # create connectors @@ -41,12 +43,12 @@ def test_connector_deletion(reset: None, vespa_client: TestVespaClient) -> None: cc_pair_1 = DocumentManager.seed_and_attach_docs( cc_pair=cc_pair_1, num_docs=NUM_DOCS, - user_with_api_key=admin_user, + api_key=api_key, ) cc_pair_2 = DocumentManager.seed_and_attach_docs( cc_pair=cc_pair_2, num_docs=NUM_DOCS, - user_with_api_key=admin_user, + api_key=api_key, ) # create document sets @@ -152,8 +154,8 @@ def test_connector_deletion_for_overlapping_connectors( # Creating an admin user (first user created is automatically an admin) admin_user: TestUser = UserManager.create(name="admin_user") # add api key to user - admin_user = UserManager.add_api_key_to_user( - user=admin_user, + api_key: TestAPIKey = APIKeyManager.create( + user_performing_action=admin_user, ) # create connectors @@ -170,12 +172,12 @@ def test_connector_deletion_for_overlapping_connectors( cc_pair_1 = DocumentManager.seed_and_attach_docs( cc_pair=cc_pair_1, document_ids=doc_ids, - user_with_api_key=admin_user, + api_key=api_key, ) cc_pair_2 = DocumentManager.seed_and_attach_docs( cc_pair=cc_pair_2, document_ids=doc_ids, - user_with_api_key=admin_user, + api_key=api_key, ) # verify vespa document exists and that it is not in any document sets or groups diff --git a/backend/tests/integration/tests/dev_apis/test_simple_chat_api.py b/backend/tests/integration/tests/dev_apis/test_simple_chat_api.py index 01cdf7e7540..981a9cbd026 100644 --- a/backend/tests/integration/tests/dev_apis/test_simple_chat_api.py +++ b/backend/tests/integration/tests/dev_apis/test_simple_chat_api.py @@ -4,11 +4,13 @@ from tests.integration.common_utils.constants import API_SERVER_URL from tests.integration.common_utils.constants import NUM_DOCS from tests.integration.common_utils.llm import LLMProviderManager +from tests.integration.common_utils.managers.api_key import APIKeyManager from tests.integration.common_utils.managers.cc_pair import CCPairManager -from tests.integration.common_utils.managers.cc_pair import TestCCPair from tests.integration.common_utils.managers.document import DocumentManager -from tests.integration.common_utils.managers.user import TestUser from tests.integration.common_utils.managers.user import UserManager +from tests.integration.common_utils.test_models import TestAPIKey +from tests.integration.common_utils.test_models import TestCCPair +from tests.integration.common_utils.test_models import TestUser def test_send_message_simple_with_history(reset: None) -> None: @@ -19,14 +21,14 @@ def test_send_message_simple_with_history(reset: None) -> None: cc_pair_1: TestCCPair = CCPairManager.create_from_scratch( user_performing_action=admin_user, ) - admin_user = UserManager.add_api_key_to_user( - user=admin_user, + api_key: TestAPIKey = APIKeyManager.create( + user_performing_action=admin_user, ) LLMProviderManager.create(user_performing_action=admin_user) cc_pair_1 = DocumentManager.seed_and_attach_docs( cc_pair=cc_pair_1, num_docs=NUM_DOCS, - user_with_api_key=admin_user, + api_key=api_key, ) response = requests.post( diff --git a/backend/tests/integration/tests/document_set/test_syncing.py b/backend/tests/integration/tests/document_set/test_syncing.py index 55fc7f1091e..ab31b751471 100644 --- a/backend/tests/integration/tests/document_set/test_syncing.py +++ b/backend/tests/integration/tests/document_set/test_syncing.py @@ -1,10 +1,12 @@ from danswer.server.documents.models import DocumentSource from tests.integration.common_utils.constants import NUM_DOCS +from tests.integration.common_utils.managers.api_key import APIKeyManager from tests.integration.common_utils.managers.cc_pair import CCPairManager from tests.integration.common_utils.managers.document import DocumentManager from tests.integration.common_utils.managers.document_set import DocumentSetManager -from tests.integration.common_utils.managers.user import TestUser from tests.integration.common_utils.managers.user import UserManager +from tests.integration.common_utils.test_models import TestAPIKey +from tests.integration.common_utils.test_models import TestUser from tests.integration.common_utils.vespa import TestVespaClient @@ -15,8 +17,8 @@ def test_multiple_document_sets_syncing_same_connnector( admin_user: TestUser = UserManager.create(name="admin_user") # add api key to user - admin_user = UserManager.add_api_key_to_user( - user=admin_user, + api_key: TestAPIKey = APIKeyManager.create( + user_performing_action=admin_user, ) # create connector @@ -29,7 +31,7 @@ def test_multiple_document_sets_syncing_same_connnector( cc_pair_1 = DocumentManager.seed_and_attach_docs( cc_pair=cc_pair_1, num_docs=NUM_DOCS, - user_with_api_key=admin_user, + api_key=api_key, ) # Create document sets diff --git a/backend/tests/integration/tests/permissions/test_cc_pair_permissions.py b/backend/tests/integration/tests/permissions/test_cc_pair_permissions.py index cff5500a881..c52c5826eae 100644 --- a/backend/tests/integration/tests/permissions/test_cc_pair_permissions.py +++ b/backend/tests/integration/tests/permissions/test_cc_pair_permissions.py @@ -32,7 +32,7 @@ def test_cc_pair_permissions(reset: None) -> None: user_groups_to_check=[user_group_1], user_performing_action=admin_user ) # setting the user as a curator for the user group - UserGroupManager.set_user_to_curator( + UserGroupManager.set_curator_status( test_user_group=user_group_1, user_to_set_as_curator=curator, user_performing_action=admin_user, @@ -83,13 +83,9 @@ def test_cc_pair_permissions(reset: None) -> None: # END OF HAPPY PATH - """ - Curators should not be able to: - - Create a public cc pair - - Create a cc pair for a user group they are not a curator of - - Create a cc pair for a user group that the connector does not belong to (NOT WORKING) - - Create a cc pair for a user group that the credential does not belong to - """ + """Tests for things Curators should not be able to do""" + + # Curators should not be able to create a public cc pair with pytest.raises(HTTPError): CCPairManager.create( connector_id=connector_1.id, @@ -100,6 +96,8 @@ def test_cc_pair_permissions(reset: None) -> None: user_performing_action=curator, ) + # Curators should not be able to create a cc + # pair for a user group they are not a curator of with pytest.raises(HTTPError): CCPairManager.create( connector_id=connector_1.id, @@ -110,8 +108,22 @@ def test_cc_pair_permissions(reset: None) -> None: user_performing_action=curator, ) - # This test is currently disabled because permissions are - # not enforced at the connector level + # Curators should not be able to create a cc + # pair without an attached user group + with pytest.raises(HTTPError): + CCPairManager.create( + connector_id=connector_1.id, + credential_id=credential_1.id, + name="invalid_cc_pair_2", + groups=[], + is_public=False, + user_performing_action=curator, + ) + + # # This test is currently disabled because permissions are + # # not enforced at the connector level + # # Curators should not be able to create a cc pair + # # for a user group that the connector does not belong to (NOT WORKING) # with pytest.raises(HTTPError): # CCPairManager.create( # connector_id=connector_2.id, @@ -122,6 +134,8 @@ def test_cc_pair_permissions(reset: None) -> None: # user_performing_action=curator, # ) + # Curators should not be able to create a cc + # pair for a user group that the credential does not belong to with pytest.raises(HTTPError): CCPairManager.create( connector_id=connector_1.id, @@ -132,10 +146,10 @@ def test_cc_pair_permissions(reset: None) -> None: user_performing_action=curator, ) - """ - Curators should be able to: - - Create a private cc pair for a user group they are a curator of - """ + """Tests for things Curators should be able to do""" + + # Curators should be able to create a private + # cc pair for a user group they are a curator of valid_cc_pair = CCPairManager.create( name="valid_cc_pair", connector_id=connector_1.id, diff --git a/backend/tests/integration/tests/permissions/test_connector_permissions.py b/backend/tests/integration/tests/permissions/test_connector_permissions.py index 29ede166b41..279c0568bfb 100644 --- a/backend/tests/integration/tests/permissions/test_connector_permissions.py +++ b/backend/tests/integration/tests/permissions/test_connector_permissions.py @@ -30,7 +30,7 @@ def test_connector_permissions(reset: None) -> None: user_groups_to_check=[user_group_1], user_performing_action=admin_user ) # setting the user as a curator for the user group - UserGroupManager.set_user_to_curator( + UserGroupManager.set_curator_status( test_user_group=user_group_1, user_to_set_as_curator=curator, user_performing_action=admin_user, @@ -49,11 +49,9 @@ def test_connector_permissions(reset: None) -> None: # END OF HAPPY PATH - """ - Curators should not be able to: - - Create a public connector - - Create a connector for a user group they are not a curator of - """ + """Tests for things Curators should not be able to do""" + + # Curators should not be able to create a public connector with pytest.raises(HTTPError): ConnectorManager.create( name="invalid_connector_1", @@ -63,6 +61,8 @@ def test_connector_permissions(reset: None) -> None: user_performing_action=curator, ) + # Curators should not be able to create a cc pair for a + # user group they are not a curator of with pytest.raises(HTTPError): ConnectorManager.create( name="invalid_connector_2", @@ -72,10 +72,10 @@ def test_connector_permissions(reset: None) -> None: user_performing_action=curator, ) - """ - Curators should be able to: - - Create a private connector for a user group they are a curator of - """ + """Tests for things Curators should be able to do""" + + # Curators should be able to create a private + # connector for a user group they are a curator of valid_connector = ConnectorManager.create( name="valid_connector", source=DocumentSource.CONFLUENCE, diff --git a/backend/tests/integration/tests/permissions/test_credential_permissions.py b/backend/tests/integration/tests/permissions/test_credential_permissions.py index 20143dfd299..1311f1a3d2d 100644 --- a/backend/tests/integration/tests/permissions/test_credential_permissions.py +++ b/backend/tests/integration/tests/permissions/test_credential_permissions.py @@ -30,7 +30,7 @@ def test_credential_permissions(reset: None) -> None: user_groups_to_check=[user_group_1], user_performing_action=admin_user ) # setting the user as a curator for the user group - UserGroupManager.set_user_to_curator( + UserGroupManager.set_curator_status( test_user_group=user_group_1, user_to_set_as_curator=curator, user_performing_action=admin_user, @@ -49,11 +49,9 @@ def test_credential_permissions(reset: None) -> None: # END OF HAPPY PATH - """ - Curators should not be able to: - - Create a public credential - - Create a credential for a user group they are not a curator of - """ + """Tests for things Curators should not be able to do""" + + # Curators should not be able to create a public credential with pytest.raises(HTTPError): CredentialManager.create( name="invalid_credential_1", @@ -63,6 +61,7 @@ def test_credential_permissions(reset: None) -> None: user_performing_action=curator, ) + # Curators should not be able to create a credential for a user group they are not a curator of with pytest.raises(HTTPError): CredentialManager.create( name="invalid_credential_2", @@ -72,10 +71,8 @@ def test_credential_permissions(reset: None) -> None: user_performing_action=curator, ) - """ - Curators should be able to: - - Create a private credential for a user group they are a curator of - """ + """Tests for things Curators should be able to do""" + # Curators should be able to create a private credential for a user group they are a curator of valid_credential = CredentialManager.create( name="valid_credential", source=DocumentSource.CONFLUENCE, diff --git a/backend/tests/integration/tests/permissions/test_doc_set_permissions.py b/backend/tests/integration/tests/permissions/test_doc_set_permissions.py index 2dbccf9d936..a2601bf4e46 100644 --- a/backend/tests/integration/tests/permissions/test_doc_set_permissions.py +++ b/backend/tests/integration/tests/permissions/test_doc_set_permissions.py @@ -28,7 +28,7 @@ def test_doc_set_permissions_setup(reset: None) -> None: ) # Setting the curator as a curator for the first user group - UserGroupManager.set_user_to_curator( + UserGroupManager.set_curator_status( test_user_group=user_group_1, user_to_set_as_curator=curator, user_performing_action=admin_user, @@ -61,15 +61,8 @@ def test_doc_set_permissions_setup(reset: None) -> None: # END OF HAPPY PATH - """ - Curators should not be able to: - - Create a public document set - - Create a document set for a user group they are not a curator of - - Create a document set for zero user groups - No one should be able to: - - create a document set with no cc_pairs - - add a private cc_pair to a doc_set that doesn't share a mutual parent group - """ + """Tests for things Curators/Admins should not be able to do""" + # Test that curator cannot create a document set for the group they don't curate with pytest.raises(HTTPError): DocumentSetManager.create( @@ -109,6 +102,17 @@ def test_doc_set_permissions_setup(reset: None) -> None: user_performing_action=curator, ) + # Test that admin cannot create a document set with no cc_pairs + with pytest.raises(HTTPError): + DocumentSetManager.create( + name="Invalid Document Set 4", + is_public=False, + cc_pair_ids=[], + groups=[user_group_1.id], + user_performing_action=admin_user, + ) + + """Tests for things Curators should be able to do""" # Test that curator can create a document set for the group they curate valid_doc_set = DocumentSetManager.create( name="Valid Document Set", diff --git a/backend/tests/integration/tests/permissions/test_user_role_permissions.py b/backend/tests/integration/tests/permissions/test_user_role_permissions.py index 32ba97bc9e7..5da91a57af8 100644 --- a/backend/tests/integration/tests/permissions/test_user_role_permissions.py +++ b/backend/tests/integration/tests/permissions/test_user_role_permissions.py @@ -72,7 +72,7 @@ def test_user_role_setting_permissions(reset: None) -> None: # This should fail because the curator is not in the user group with pytest.raises(HTTPError): - UserGroupManager.set_user_to_curator( + UserGroupManager.set_curator_status( test_user_group=user_group_1, user_to_set_as_curator=curator, user_performing_action=admin_user, @@ -86,7 +86,7 @@ def test_user_role_setting_permissions(reset: None) -> None: ) # This should work because the curator is in the user group - UserGroupManager.set_user_to_curator( + UserGroupManager.set_curator_status( test_user_group=user_group_1, user_to_set_as_curator=curator, user_performing_action=admin_user, diff --git a/backend/tests/integration/tests/permissions/test_whole_curator_flow.py b/backend/tests/integration/tests/permissions/test_whole_curator_flow.py index 448def312a5..878ba1e17e8 100644 --- a/backend/tests/integration/tests/permissions/test_whole_curator_flow.py +++ b/backend/tests/integration/tests/permissions/test_whole_curator_flow.py @@ -30,7 +30,7 @@ def test_whole_curator_flow(reset: None) -> None: user_groups_to_check=[user_group_1], user_performing_action=admin_user ) # Making curator a curator of user_group_1 - UserGroupManager.set_user_to_curator( + UserGroupManager.set_curator_status( test_user_group=user_group_1, user_to_set_as_curator=curator, user_performing_action=admin_user,