mirror of
https://github.com/simonw/datasette.git
synced 2026-10-22 01:07:03 +02:00
Add regression test for query form action
This commit is contained in:
parent
86240c7bf9
commit
5fca43ddad
1 changed files with 12 additions and 0 deletions
12
tests/test_query_form_action.py
Normal file
12
tests/test_query_form_action.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import pytest
|
||||
from bs4 import BeautifulSoup as Soup
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_ad_hoc_query_form_posts_to_query_route(ds_client):
|
||||
response = await ds_client.get("/fixtures/-/query?sql=select+1")
|
||||
assert response.status_code == 200
|
||||
|
||||
form = Soup(response.text, "html.parser").select_one("form.sql.core")
|
||||
assert form is not None
|
||||
assert form["action"] == "/fixtures/-/query"
|
||||
Loading…
Add table
Add a link
Reference in a new issue