datasette/tests/test_query_form_action.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
400 B
Python
Raw Normal View History

import pytest
from bs4 import BeautifulSoup as Soup
@pytest.mark.asyncio
async def test_ad_hoc_query_form_targets_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"