mirror of
https://github.com/simonw/datasette.git
synced 2026-06-12 20:16:56 +02:00
Centralize JSON extra parsing
This commit is contained in:
parent
6eaa9e3199
commit
03f1ffdf8f
4 changed files with 21 additions and 6 deletions
|
|
@ -1376,6 +1376,17 @@ async def test_table_extras(ds_client, extra, expected_json):
|
|||
assert response.json() == expected_json
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_table_extra_columns_can_be_comma_separated(ds_client):
|
||||
response = await ds_client.get(
|
||||
"/fixtures/primary_key_multiple_columns.json?_extra=columns,count"
|
||||
)
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
assert data["columns"] == ["id", "content", "content2"]
|
||||
assert data["count"] == 1
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_extra_render_cell():
|
||||
"""Test that _extra=render_cell returns rendered HTML from render_cell plugin hook"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue