Skip to content

Commit 04600a3

Browse files
committed
Finalize test
1 parent 76c0a9a commit 04600a3

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/api/test_api.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,25 @@ async def test_app_query_extension_gte(load_test_data, app_client, load_test_col
272272

273273

274274
async 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

287296
async def test_app_sort_extension(load_test_data, app_client, load_test_collection):

0 commit comments

Comments
 (0)