mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Implemented ArrayFacet, closes #359
This commit is contained in:
parent
ea66c45df9
commit
53d2f00b73
3 changed files with 185 additions and 4 deletions
|
|
@ -1300,14 +1300,20 @@ def test_suggested_facets(app_client):
|
|||
} for suggestion in app_client.get(
|
||||
"/fixtures/facetable.json"
|
||||
).json["suggested_facets"]]
|
||||
assert [
|
||||
expected = [
|
||||
{"name": "planet_int", "querystring": "_facet=planet_int"},
|
||||
{"name": "on_earth", "querystring": "_facet=on_earth"},
|
||||
{"name": "state", "querystring": "_facet=state"},
|
||||
{"name": "city_id", "querystring": "_facet=city_id"},
|
||||
{"name": "neighborhood", "querystring": "_facet=neighborhood"},
|
||||
{"name": "tags", "querystring": "_facet=tags"}
|
||||
] == suggestions
|
||||
]
|
||||
if detect_json1():
|
||||
expected.append({
|
||||
"name": "tags",
|
||||
"querystring": "_facet_array=tags"
|
||||
})
|
||||
assert expected == suggestions
|
||||
|
||||
|
||||
def test_allow_facet_off():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue