diff --git a/app/tests/tests_10/test_collections_endpoint.py b/app/tests/tests_10/test_collections_endpoint.py index 3c36e1d1..6ed9fc58 100644 --- a/app/tests/tests_10/test_collections_endpoint.py +++ b/app/tests/tests_10/test_collections_endpoint.py @@ -70,6 +70,26 @@ def test_single_collection_endpoint(self): self.check_stac_collection(self.collection_1.json, response_json) + def test_filtering_by_provider(self): + collection_with_provider = self.factory.create_sample( + sample='collection-1', + name='collection-provider', + providers=[{ + 'name': 'test-provider' + }], + db_create=True + ) + + response = self.client.get(f"/{STAC_BASE_V}/collections?provider=test-provider") + response_json = response.json() + self.assertStatusCode(200, response) + + self.assertEqual( + len(response_json['collections']), + 1, + msg=f"Only one collection should be returned. Response: {response_json}" + ) + @mock_s3_asset_file def test_single_collection_assets_endpoint(self): asset_count = 3