mirror of
https://github.com/simonw/datasette.git
synced 2026-11-20 00:58:31 +01:00
test: cover stored query action with base_url
This commit is contained in:
parent
385536eb87
commit
d37284ac03
1 changed files with 18 additions and 0 deletions
|
|
@ -33,3 +33,21 @@ async def test_stored_query_form_action_encodes_query_name(ds_client):
|
||||||
form = Soup(response.text, "html.parser").select_one("form.sql.core")
|
form = Soup(response.text, "html.parser").select_one("form.sql.core")
|
||||||
assert form is not None
|
assert form is not None
|
||||||
assert form["action"] == query_url
|
assert form["action"] == query_url
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_stored_query_form_action_preserves_base_url(
|
||||||
|
app_client_base_url_prefix,
|
||||||
|
):
|
||||||
|
query_name = "query with spaces"
|
||||||
|
await app_client_base_url_prefix.ds.update_query(
|
||||||
|
"fixtures", query_name, sql="select 1"
|
||||||
|
)
|
||||||
|
query_url = app_client_base_url_prefix.ds.urls.query("fixtures", query_name)
|
||||||
|
|
||||||
|
response = app_client_base_url_prefix.get(query_url)
|
||||||
|
assert response.status_code == 200
|
||||||
|
|
||||||
|
form = Soup(response.text, "html.parser").select_one("form.sql.core")
|
||||||
|
assert form is not None
|
||||||
|
assert form["action"] == query_url
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue