Centralize JSON extra parsing

This commit is contained in:
Simon Willison 2026-06-08 20:45:01 -07:00
commit 03f1ffdf8f
4 changed files with 21 additions and 6 deletions

View file

@ -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"""