@@ -272,16 +272,25 @@ async def test_app_query_extension_gte(load_test_data, app_client, load_test_col
272272
273273
274274async def test_app_collection_fields_extension (
275- load_test_data , app_client , load_test_collection
275+ load_test_data , app_client , load_test_collection , app
276276):
277- fields = ["id" , "title" ]
277+ if app .state .settings .enable_response_models :
278+ # https://github.com/stac-utils/stac-fastapi-pgstac/issues/328
279+ pytest .skip ("Skipping test when model_validation is enabled, see #328" )
280+
281+ fields = ["title" ]
278282 resp = await app_client .get ("/collections" , params = {"fields" : "," .join (fields )})
283+
279284 assert resp .status_code == 200
285+
280286 resp_json = resp .json ()
281287 resp_collections = resp_json ["collections" ]
288+
282289 assert len (resp_collections ) > 0
290+ # NOTE: It's a bug that 'collection' is always included; see #327
291+ constant_fields = ["id" , "links" , "collection" ]
283292 for collection in resp_collections :
284- assert set (collection .keys ()) == set (fields + [ "links" , "collection" ] )
293+ assert set (collection .keys ()) == set (fields + constant_fields )
285294
286295
287296async def test_app_sort_extension (load_test_data , app_client , load_test_collection ):
0 commit comments