Persist _where= in hidden fields, closes #604

This commit is contained in:
Simon Willison 2019-10-30 11:49:26 -07:00
commit e2c390500e
2 changed files with 9 additions and 0 deletions

View file

@ -955,6 +955,12 @@ def test_extra_where_clauses(app_client):
"/fixtures/facetable?_where=city_id%3D1",
"/fixtures/facetable?_where=neighborhood%3D%27Dogpatch%27",
] == hrefs
# These should also be persisted as hidden fields
inputs = soup.find("form").findAll("input")
hiddens = [i for i in inputs if i["type"] == "hidden"]
assert [("_where", "neighborhood='Dogpatch'"), ("_where", "city_id=1")] == [
(hidden["name"], hidden["value"]) for hidden in hiddens
]
def test_binary_data_display(app_client):