mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Magic parameters for canned queries
Closes #842 Includes a new plugin hook, register_magic_parameters()
This commit is contained in:
parent
4b142862f2
commit
563f5a2d3a
14 changed files with 477 additions and 167 deletions
|
|
@ -601,18 +601,6 @@ def test_custom_sql(app_client):
|
|||
assert not data["truncated"]
|
||||
|
||||
|
||||
def test_canned_query_with_named_parameter(app_client):
|
||||
response = app_client.get("/fixtures/neighborhood_search.json?text=town")
|
||||
assert [
|
||||
["Corktown", "Detroit", "MI"],
|
||||
["Downtown", "Los Angeles", "CA"],
|
||||
["Downtown", "Detroit", "MI"],
|
||||
["Greektown", "Detroit", "MI"],
|
||||
["Koreatown", "Los Angeles", "CA"],
|
||||
["Mexicantown", "Detroit", "MI"],
|
||||
] == response.json["rows"]
|
||||
|
||||
|
||||
def test_sql_time_limit(app_client_shorter_time_limit):
|
||||
response = app_client_shorter_time_limit.get("/fixtures.json?sql=select+sleep(0.5)")
|
||||
assert 400 == response.status
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue