mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_nofacets=1 option, closes #1350
This commit is contained in:
parent
f7d3e76fb3
commit
c5ae1197a2
4 changed files with 28 additions and 7 deletions
|
|
@ -1669,6 +1669,20 @@ def test_suggest_facets_off():
|
|||
assert [] == client.get("/fixtures/facetable.json").json["suggested_facets"]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("nofacets", (True, False))
|
||||
def test_nofacets(app_client, nofacets):
|
||||
path = "/fixtures/facetable.json?_facet=state"
|
||||
if nofacets:
|
||||
path += "&_nofacets=1"
|
||||
response = app_client.get(path)
|
||||
if nofacets:
|
||||
assert response.json["suggested_facets"] == []
|
||||
assert response.json["facet_results"] == {}
|
||||
else:
|
||||
assert response.json["suggested_facets"] != []
|
||||
assert response.json["facet_results"] != {}
|
||||
|
||||
|
||||
def test_expand_labels(app_client):
|
||||
response = app_client.get(
|
||||
"/fixtures/facetable.json?_shape=object&_labels=1&_size=2"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue