Skip to content

Commit

Permalink
fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Jan 22, 2025
1 parent 8573eca commit 255b64d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,21 @@ async def batch_get_trashed_by_primary_gid(
Returns:
values of trashed_by_primary_gid in the SAME ORDER as projects_uuids
"""
if not projects_uuids:
return []

projects_uuids_str = [f"{uuid}" for uuid in projects_uuids]

query = (
sa.select(
users.c.primary_gid.label("trashed_by_primary_gid"),
)
.select_from(projects.outerjoin(users, projects.c.trashed_by == users.c.id))
.where(projects.c.uuid.in_(projects_uuids_str))
).order_by(
# Preserves the order of projects_uuids
sa.case(
*[
(projects.c.uuid == uuid, index)
for index, uuid in enumerate(projects_uuids_str)
]
)
*[
projects.c.uuid == uuid for uuid in projects_uuids_str
] # Preserves the order of project_uuids
)
async with pass_or_acquire_connection(get_asyncpg_engine(app), connection) as conn:
result = await conn.stream(query)
Expand Down
2 changes: 1 addition & 1 deletion services/web/server/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ async def _creator(
"folderId",
]

for key in new_project:
for key in expected_data:
if key not in modified_fields:
assert expected_data[key] == new_project[key]

Expand Down

0 comments on commit 255b64d

Please sign in to comment.