Skip to content

Commit 483466f

Browse files
committed
test default sort
1 parent b1c64a4 commit 483466f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stac_fastapi/tests/api/test_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,3 +1596,13 @@ async def test_collection_items_sort_asc(app_client, txn_client, ctx):
15961596
resp_json = resp.json()
15971597
assert resp_json["features"][0]["id"] == second_item["id"]
15981598
assert resp_json["features"][1]["id"] == first_item["id"]
1599+
1600+
# Also verify bare field (no +) sorts ascending by default
1601+
resp = await app_client.get(
1602+
f"/collections/{first_item['collection']}/items",
1603+
params=[("sortby", "properties.datetime")],
1604+
)
1605+
assert resp.status_code == 200
1606+
resp_json = resp.json()
1607+
assert resp_json["features"][0]["id"] == second_item["id"]
1608+
assert resp_json["features"][1]["id"] == first_item["id"]

0 commit comments

Comments
 (0)