From 174099b70757f0d3631ad9e386b17e25778ebe91 Mon Sep 17 00:00:00 2001 From: Alex Garcia Date: Fri, 10 Jul 2026 11:01:38 -0700 Subject: [PATCH] Update test_execute_sql schema assertions for rich completion shape Follow-up to d12f0d2c: the test regexes the inlined schema= JS and still asserted the old flat list-of-strings shape. Co-Authored-By: Claude Fable 5 --- tests/test_permissions.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/test_permissions.py b/tests/test_permissions.py index 88fe577f..892777e1 100644 --- a/tests/test_permissions.py +++ b/tests/test_permissions.py @@ -295,13 +295,24 @@ def test_execute_sql(config): # Extract the schema= portion of the JavaScript schema_json = schema_re.search(response_text).group(1) schema = json.loads(schema_json) - assert set(schema["attraction_characteristic"]) == {"name", "pk"} - assert schema["paginated_view"] == [] + assert {c["label"] for c in schema["attraction_characteristic"]} == { + "name", + "pk", + } + # Views are self/children containers carrying their real columns + assert schema["paginated_view"]["self"]["detail"] == "view" + assert {c["label"] for c in schema["paginated_view"]["children"]} == { + "content", + "content_extra", + } assert form_fragment in response_text query_response = client.get("/fixtures/-/query?sql=select+1", cookies=cookies) assert query_response.status == 200 schema2 = json.loads(schema_re.search(query_response.text).group(1)) - assert set(schema2["attraction_characteristic"]) == {"name", "pk"} + assert {c["label"] for c in schema2["attraction_characteristic"]} == { + "name", + "pk", + } assert ( client.get("/fixtures/facet_cities?_where=id=3", cookies=cookies).status == 200