Skip to content

Commit

Permalink
Tweak model creation in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheByronHimes committed Sep 4, 2023
1 parent 4cb22d3 commit aba8f1f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ async def test_sort_with_id_not_last(joint_fixture: JointFixture):
any bugs that will break the sort or query process.
"""
sorts = [
{"field": "id_", "order": models.SortOrder.ASCENDING.value},
{"field": "field", "order": models.SortOrder.DESCENDING.value},
{"field": "id_", "order": "ascending"},
{"field": "field", "order": "descending"},
]
search_parameters: JsonObject = {
"class_name": CLASS_NAME,
Expand All @@ -84,7 +84,12 @@ async def test_sort_with_id_not_last(joint_fixture: JointFixture):
"sorting_parameters": sorts,
}

sorts_in_model_form = [models.SortingParameter(**param) for param in sorts]
sorts_in_model_form = [
models.SortingParameter(
field=param["field"], order=models.SortOrder(param["order"])
)
for param in sorts
]
results = await joint_fixture.call_search_endpoint(search_parameters)
assert results.hits == sort_resources(results.hits, sorts_in_model_form)

Expand Down

0 comments on commit aba8f1f

Please sign in to comment.