mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Don't show facet in cog menu if not allow_facet, closes #1683
This commit is contained in:
parent
d431a9055e
commit
c496f2b663
4 changed files with 26 additions and 2 deletions
|
|
@ -1075,3 +1075,17 @@ def test_table_page_title(app_client, path, expected):
|
|||
response = app_client.get(path)
|
||||
title = Soup(response.text, "html.parser").find("title").text
|
||||
assert title == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize("allow_facet", (True, False))
|
||||
def test_allow_facet_off(allow_facet):
|
||||
with make_app_client(settings={"allow_facet": allow_facet}) as client:
|
||||
response = client.get("/fixtures/facetable")
|
||||
expected = "DATASETTE_ALLOW_FACET = {};".format(
|
||||
"true" if allow_facet else "false"
|
||||
)
|
||||
assert expected in response.text
|
||||
if allow_facet:
|
||||
assert "Suggested facets" in response.text
|
||||
else:
|
||||
assert "Suggested facets" not in response.text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue