File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,22 @@ async def test_get_collections_search(
528
528
)
529
529
assert len (resp .json ()["collections" ]) == 2
530
530
531
+ # this search should return test collection 1 first
532
+ resp = await app_client .get (
533
+ "/collections" ,
534
+ params = {"sortby" : "title" },
535
+ )
536
+ assert resp .json ()["collections" ][0 ]["id" ] == load_test_collection ["id" ]
537
+ assert resp .json ()["collections" ][1 ]["id" ] == load_test2_collection .id
538
+
539
+ # this search should return test collection 2 first
540
+ resp = await app_client .get (
541
+ "/collections" ,
542
+ params = {"sortby" : "-title" },
543
+ )
544
+ assert resp .json ()["collections" ][1 ]["id" ] == load_test_collection ["id" ]
545
+ assert resp .json ()["collections" ][0 ]["id" ] == load_test2_collection .id
546
+
531
547
532
548
@pytest .mark .asyncio
533
549
async def test_item_collection_filter_bbox (
Original file line number Diff line number Diff line change @@ -149,14 +149,19 @@ def api_client(request, database):
149
149
search_post_request_model = create_post_request_model (
150
150
extensions , base_model = PgstacSearch
151
151
)
152
+
153
+ collections_get_request_model = create_get_request_model (
154
+ extensions + collection_extensions
155
+ )
156
+
152
157
api = StacApi (
153
158
settings = api_settings ,
154
159
extensions = extensions + collection_extensions ,
155
160
client = CoreCrudClient (post_request_model = search_post_request_model ),
156
161
items_get_request_model = items_get_request_model ,
157
162
search_get_request_model = search_get_request_model ,
158
163
search_post_request_model = search_post_request_model ,
159
- collections_get_request_model = CollectionSearchExtension (). GET ,
164
+ collections_get_request_model = collections_get_request_model ,
160
165
response_class = ORJSONResponse ,
161
166
router = APIRouter (prefix = prefix ),
162
167
)
You can’t perform that action at this time.
0 commit comments