mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
No hidden SQL on canned query pages, closes #1411
This commit is contained in:
parent
ff253f5242
commit
4adca0d850
2 changed files with 12 additions and 1 deletions
|
|
@ -1238,6 +1238,17 @@ def test_show_hide_sql_query(app_client):
|
|||
] == [(hidden["name"], hidden["value"]) for hidden in hiddens]
|
||||
|
||||
|
||||
def test_canned_query_with_hide_has_no_hidden_sql(app_client):
|
||||
# For a canned query the show/hide should NOT have a hidden SQL field
|
||||
# https://github.com/simonw/datasette/issues/1411
|
||||
response = app_client.get("/fixtures/neighborhood_search?_hide_sql=1")
|
||||
soup = Soup(response.body, "html.parser")
|
||||
hiddens = soup.find("form").select("input[type=hidden]")
|
||||
assert [
|
||||
("_hide_sql", "1"),
|
||||
] == [(hidden["name"], hidden["value"]) for hidden in hiddens]
|
||||
|
||||
|
||||
def test_extra_where_clauses(app_client):
|
||||
response = app_client.get(
|
||||
"/fixtures/facetable?_where=neighborhood='Dogpatch'&_where=city_id=1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue