Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
task/189 fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvanich9 committed Nov 24, 2023
1 parent ea0e52f commit 706894c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sapphire/projects/database/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ async def get_positions(
project_status=project_status,
)

statement = select(Position).where(*filters)
statement = select(Position).where(*filters).order_by(Position.created_at.desc())

offset = (page - 1) * per_page
statement = statement.limit(per_page).offset(offset)
Expand Down
2 changes: 1 addition & 1 deletion tests/projects/database/test_projects_database_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async def test_get_project_positions(database_service: ProjectsDatabaseService):
expected_positions = [
Position(id=uuid.uuid4(), specialization_id=specialization_id, project_id=project_id)
]
expected_query = select(Position).where(Position.project_id == project_id)
expected_query = select(Position).where(Position.project_id == project_id).order_by(Position.created_at.desc()).offset(0).limit(10)
result.unique().scalars.return_value.all.return_value = expected_positions
session.execute = AsyncMock()
session.execute.return_value = result
Expand Down

0 comments on commit 706894c

Please sign in to comment.