kopia lustrzana https://github.com/simonw/datasette
WIP implementation of #1179
rodzic
b6a7b58fa0
commit
9564ce08cc
|
@ -490,6 +490,7 @@ class DataView(BaseView):
|
|||
table=data.get("table"),
|
||||
request=request,
|
||||
view_name=self.name,
|
||||
full_path=path_with_format(request=request, format="", replace_format=_format),
|
||||
# These will be deprecated in Datasette 1.0:
|
||||
args=request.args,
|
||||
data=data,
|
||||
|
@ -534,6 +535,8 @@ class DataView(BaseView):
|
|||
table=data.get("table"),
|
||||
request=request,
|
||||
view_name=self.name,
|
||||
path=request.path,
|
||||
full_path=request.full_path,
|
||||
)
|
||||
it_can_render = await await_me_maybe(it_can_render)
|
||||
if it_can_render:
|
||||
|
|
|
@ -24,7 +24,17 @@ async def can_render(
|
|||
|
||||
|
||||
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 = {}
|
||||
for custom_header in request.args.getlist("header"):
|
||||
|
@ -44,6 +54,7 @@ async def render_test_all_parameters(
|
|||
"request": request,
|
||||
"view_name": view_name,
|
||||
"1+1": result.first()[0],
|
||||
"full_path": full_path,
|
||||
},
|
||||
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):
|
||||
response = app_client.get("/fixtures/facetable.testall")
|
||||
response = app_client.get("/fixtures/facetable.testall?_ignore=1")
|
||||
assert 200 == response.status
|
||||
# Lots of 'at 0x103a4a690' in here - replace those so we can do
|
||||
# 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>",
|
||||
"view_name": "table",
|
||||
"1+1": 2,
|
||||
"full_path": "/fixtures/facetable?_ignore=1",
|
||||
}
|
||||
# Test that query_name is set correctly
|
||||
query_response = app_client.get("/fixtures/pragma_cache_size.testall")
|
||||
|
|
Ładowanie…
Reference in New Issue