?_where= parameter on table views, closes #429

From pull request #430
This commit is contained in:
Simon Willison 2019-04-12 18:37:22 -07:00 committed by GitHub
commit bc6a9b4564
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 92 additions and 2 deletions

View file

@ -869,3 +869,17 @@ def test_show_hide_sql_query(app_client):
] == [
(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"
)
soup = Soup(response.body, "html.parser")
div = soup.select(".extra-wheres")[0]
assert "2 extra where clauses" == div.find("h3").text
hrefs = [a["href"] for a in div.findAll("a")]
assert [
"/fixtures/facetable?_where=city_id%3D1",
"/fixtures/facetable?_where=neighborhood%3D%27Dogpatch%27"
] == hrefs