diff --git a/test/unit/data/model/db/test_role.py b/test/unit/data/model/db/test_role.py index fa39c8398235..1fa49ae4a998 100644 --- a/test/unit/data/model/db/test_role.py +++ b/test/unit/data/model/db/test_role.py @@ -4,7 +4,7 @@ get_private_user_role, get_roles_by_ids, ) -from galaxy.model.security import _get_valid_roles_case1 +from galaxy.model.security import _get_valid_roles_exposed from . import have_same_elements @@ -45,7 +45,7 @@ def test_get_roles_by_ids(session, make_role): have_same_elements(roles2, expected) -def test_get_valid_roles_case1(session, make_user_and_role, make_user, make_role, make_user_role_association): +def test_get_valid_roles_exposed(session, make_user_and_role, make_user, make_role, make_user_role_association): # Make 3 users with private roles ( u1, @@ -79,63 +79,63 @@ def test_get_valid_roles_case1(session, make_user_and_role, make_user, make_role is_admin = True search_query = None - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 7 # all roles returned search_query = "foo%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 2 assert rp1 in roles assert rp2 in roles search_query = "foo1%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 1 assert roles[0] == rp1 search_query = "sharing%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 2 assert rs1 in roles assert rs2 in roles search_query = "sharing role for u1%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 1 assert roles[0] == rs1 search_query = "admin role%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 2 assert ra1 in roles assert ra2 in roles search_query = "admin role1%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 1 assert roles[0] == ra1 is_admin = False # non admins should see only private roles search_query = None - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 3 search_query = "foo%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 2 assert rp1 in roles assert rp2 in roles search_query = "foo1%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 1 assert roles[0] == rp1 search_query = "sharing%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 0 search_query = "admin role%" - roles = _get_valid_roles_case1(session, search_query, is_admin, limit, page, page_limit) + roles = _get_valid_roles_exposed(session, search_query, is_admin, limit, page, page_limit) assert len(roles) == 0