mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_nosuggest=1 parameter for table views, closes #1557
This commit is contained in:
parent
20a2ed6bec
commit
992496f261
3 changed files with 20 additions and 0 deletions
|
|
@ -915,6 +915,21 @@ def test_nofacet(app_client, nofacet):
|
|||
assert response.json["facet_results"] != {}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("nosuggest", (True, False))
|
||||
def test_nosuggest(app_client, nosuggest):
|
||||
path = "/fixtures/facetable.json?_facet=state"
|
||||
if nosuggest:
|
||||
path += "&_nosuggest=1"
|
||||
response = app_client.get(path)
|
||||
if nosuggest:
|
||||
assert response.json["suggested_facets"] == []
|
||||
# But facets should still be returned:
|
||||
assert response.json["facet_results"] != {}
|
||||
else:
|
||||
assert response.json["suggested_facets"] != []
|
||||
assert response.json["facet_results"] != {}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("nocount,expected_count", ((True, None), (False, 15)))
|
||||
def test_nocount(app_client, nocount, expected_count):
|
||||
path = "/fixtures/facetable.json"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue