|
13 | 13 | from uuid import UUID, uuid5 |
14 | 14 |
|
15 | 15 | import aiopg.sa |
16 | | -import arrow |
17 | 16 | import pytest |
18 | 17 | import sqlalchemy as sa |
19 | 18 | from aiohttp.test_utils import TestClient |
|
32 | 31 | from simcore_postgres_database.utils_projects_nodes import ProjectNodesRepo |
33 | 32 | from simcore_service_webserver.projects._db_utils import PermissionStr |
34 | 33 | from simcore_service_webserver.projects._groups_db import update_or_insert_project_group |
35 | | -from simcore_service_webserver.projects._projects_db import ( |
36 | | - batch_get_trashed_by_primary_gid, |
37 | | -) |
38 | 34 | from simcore_service_webserver.projects.api import has_user_project_access_rights |
39 | 35 | from simcore_service_webserver.projects.db import ProjectAccessRights, ProjectDBAPI |
40 | 36 | from simcore_service_webserver.projects.exceptions import ( |
@@ -966,42 +962,3 @@ async def test_check_project_node_has_all_required_inputs_ok( |
966 | 962 | project_uuid=UUID(inserted_project["uuid"]), |
967 | 963 | node_id=UUID("324d6ef2-a82c-414d-9001-dc84da1cbea3"), |
968 | 964 | ) |
969 | | - |
970 | | - |
971 | | -@pytest.mark.parametrize( |
972 | | - "user_role", |
973 | | - [UserRole.USER], |
974 | | -) |
975 | | -async def test_batch_get_trashed_by_primary_gid( |
976 | | - client: TestClient, |
977 | | - logged_user: UserInfoDict, |
978 | | - insert_project_in_db: Callable[..., Awaitable[dict[str, Any]]], |
979 | | - fake_project: ProjectDict, |
980 | | -): |
981 | | - assert client.app |
982 | | - |
983 | | - # Insert two different projects |
984 | | - fake_project_1 = deepcopy(fake_project) |
985 | | - fake_project_1["trashed_by"] = logged_user["id"] |
986 | | - fake_project_1["trashed"] = arrow.now().datetime |
987 | | - fake_project_1["trashed_explicitly"] = True |
988 | | - |
989 | | - project_1 = await insert_project_in_db(fake_project_1, user_id=logged_user["id"]) |
990 | | - project_2 = await insert_project_in_db(fake_project, user_id=logged_user["id"]) |
991 | | - |
992 | | - # Test with two different project UUIDs |
993 | | - trashed_by_primary_gid = await batch_get_trashed_by_primary_gid( |
994 | | - client.app, |
995 | | - projects_uuids=[project_1["uuid"], project_2["uuid"]], |
996 | | - ) |
997 | | - assert trashed_by_primary_gid == [logged_user["primary_gid"], None] |
998 | | - |
999 | | - # Test with two identical project UUIDs |
1000 | | - trashed_by_primary_gid = await batch_get_trashed_by_primary_gid( |
1001 | | - client.app, |
1002 | | - projects_uuids=[project_1["uuid"], project_1["uuid"]], |
1003 | | - ) |
1004 | | - assert trashed_by_primary_gid == [ |
1005 | | - logged_user["primary_gid"], |
1006 | | - logged_user["primary_gid"], |
1007 | | - ] |
0 commit comments