mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Compare commits
1 commit
main
...
issue-1179
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9564ce08cc |
3 changed files with 17 additions and 2 deletions
|
|
@ -490,6 +490,7 @@ class DataView(BaseView):
|
||||||
table=data.get("table"),
|
table=data.get("table"),
|
||||||
request=request,
|
request=request,
|
||||||
view_name=self.name,
|
view_name=self.name,
|
||||||
|
full_path=path_with_format(request=request, format="", replace_format=_format),
|
||||||
# These will be deprecated in Datasette 1.0:
|
# These will be deprecated in Datasette 1.0:
|
||||||
args=request.args,
|
args=request.args,
|
||||||
data=data,
|
data=data,
|
||||||
|
|
@ -534,6 +535,8 @@ class DataView(BaseView):
|
||||||
table=data.get("table"),
|
table=data.get("table"),
|
||||||
request=request,
|
request=request,
|
||||||
view_name=self.name,
|
view_name=self.name,
|
||||||
|
path=request.path,
|
||||||
|
full_path=request.full_path,
|
||||||
)
|
)
|
||||||
it_can_render = await await_me_maybe(it_can_render)
|
it_can_render = await await_me_maybe(it_can_render)
|
||||||
if it_can_render:
|
if it_can_render:
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,17 @@ async def can_render(
|
||||||
|
|
||||||
|
|
||||||
async def render_test_all_parameters(
|
async def render_test_all_parameters(
|
||||||
datasette, columns, rows, sql, query_name, database, table, request, view_name, data
|
datasette,
|
||||||
|
columns,
|
||||||
|
rows,
|
||||||
|
sql,
|
||||||
|
query_name,
|
||||||
|
database,
|
||||||
|
table,
|
||||||
|
request,
|
||||||
|
view_name,
|
||||||
|
data,
|
||||||
|
full_path,
|
||||||
):
|
):
|
||||||
headers = {}
|
headers = {}
|
||||||
for custom_header in request.args.getlist("header"):
|
for custom_header in request.args.getlist("header"):
|
||||||
|
|
@ -44,6 +54,7 @@ async def render_test_all_parameters(
|
||||||
"request": request,
|
"request": request,
|
||||||
"view_name": view_name,
|
"view_name": view_name,
|
||||||
"1+1": result.first()[0],
|
"1+1": result.first()[0],
|
||||||
|
"full_path": full_path,
|
||||||
},
|
},
|
||||||
default=repr,
|
default=repr,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -411,7 +411,7 @@ def test_hook_register_output_renderer_no_parameters(app_client):
|
||||||
|
|
||||||
|
|
||||||
def test_hook_register_output_renderer_all_parameters(app_client):
|
def test_hook_register_output_renderer_all_parameters(app_client):
|
||||||
response = app_client.get("/fixtures/facetable.testall")
|
response = app_client.get("/fixtures/facetable.testall?_ignore=1")
|
||||||
assert 200 == response.status
|
assert 200 == response.status
|
||||||
# Lots of 'at 0x103a4a690' in here - replace those so we can do
|
# Lots of 'at 0x103a4a690' in here - replace those so we can do
|
||||||
# an easy comparison
|
# an easy comparison
|
||||||
|
|
@ -454,6 +454,7 @@ def test_hook_register_output_renderer_all_parameters(app_client):
|
||||||
"request": "<datasette.utils.asgi.Request object at 0xXXX>",
|
"request": "<datasette.utils.asgi.Request object at 0xXXX>",
|
||||||
"view_name": "table",
|
"view_name": "table",
|
||||||
"1+1": 2,
|
"1+1": 2,
|
||||||
|
"full_path": "/fixtures/facetable?_ignore=1",
|
||||||
}
|
}
|
||||||
# Test that query_name is set correctly
|
# Test that query_name is set correctly
|
||||||
query_response = app_client.get("/fixtures/pragma_cache_size.testall")
|
query_response = app_client.get("/fixtures/pragma_cache_size.testall")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue