Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pycsw/ogc/api/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def facets_(self, headers_, args, collection='metadata:main'):
LOGGER.exception(msg)
return self.get_exception(400, headers_, 'InvalidParameterValue', msg)

for value in self.config['repository']['facets']:
for value in self.facets:
facets_[value] = {
'type': 'term',
'property': value,
Expand Down
11 changes: 11 additions & 0 deletions tests/functionaltests/suites/oarec/test_oarec_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@ def test_facets(config):
assert status == 400


def test_facets_not_configured(config):
config['repository'].pop('facets')

api = API(config)
headers, status, content = api.facets_({}, {})
content = json.loads(content)

assert status == 200
assert 'type' in content['facets']


def test_items(config):
api = API(config)
headers, status, content = api.items({}, None, {})
Expand Down