mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Show error message on bad query, closes #619
This commit is contained in:
parent
9552414e1f
commit
ea5b237800
2 changed files with 12 additions and 2 deletions
|
|
@ -1402,6 +1402,16 @@ def test_zero_results(app_client, path):
|
|||
assert 1 == len(soup.select("p.zero-results"))
|
||||
|
||||
|
||||
def test_query_error(app_client):
|
||||
response = app_client.get("/fixtures?sql=select+*+from+notatable")
|
||||
html = response.text
|
||||
assert '<p class="message-error">no such table: notatable</p>' in html
|
||||
assert (
|
||||
'<textarea id="sql-editor" name="sql">select * from notatable</textarea>'
|
||||
in html
|
||||
)
|
||||
|
||||
|
||||
def test_config_template_debug_on():
|
||||
with make_app_client(config={"template_debug": True}) as client:
|
||||
response = client.get("/fixtures/facetable?_context=1")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue