generated_columns table in fixtures.py, closes #1119

This commit is contained in:
Simon Willison 2020-11-30 16:28:02 -08:00 committed by GitHub
commit 17cbbb1f7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 65 deletions

View file

@ -413,8 +413,7 @@ def test_hook_register_output_renderer_all_parameters(app_client):
# Lots of 'at 0x103a4a690' in here - replace those so we can do
# an easy comparison
body = at_memory_re.sub(" at 0xXXX", response.text)
assert {
"1+1": 2,
assert json.loads(body) == {
"datasette": "<datasette.app.Datasette object at 0xXXX>",
"columns": [
"pk",
@ -451,7 +450,8 @@ def test_hook_register_output_renderer_all_parameters(app_client):
"table": "facetable",
"request": "<datasette.utils.asgi.Request object at 0xXXX>",
"view_name": "table",
} == json.loads(body)
"1+1": 2,
}
# Test that query_name is set correctly
query_response = app_client.get("/fixtures/pragma_cache_size.testall")
assert "pragma_cache_size" == json.loads(query_response.body)["query_name"]