mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Better mechanism for handling errors; 404s for missing table/database
New error mechanism closes #193 404s for missing tables/databesse closes #184 Makes pull request #202 unnecessary.
This commit is contained in:
parent
ad6142b67c
commit
9f28bbe43d
6 changed files with 101 additions and 42 deletions
|
|
@ -208,6 +208,17 @@ def test_table_json(app_client):
|
|||
}]
|
||||
|
||||
|
||||
def test_table_not_exists_json(app_client):
|
||||
assert {
|
||||
'ok': False,
|
||||
'error': 'Table not found: blah',
|
||||
'status': 404,
|
||||
'title': None,
|
||||
} == app_client.get(
|
||||
'/test_tables/blah.json', gather_request=False
|
||||
).json
|
||||
|
||||
|
||||
def test_jsono_redirects_to_shape_objects(app_client):
|
||||
response_1 = app_client.get(
|
||||
'/test_tables/simple_primary_key.jsono',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue