mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Fix for row pages for tables with / in, closes #325
This commit is contained in:
parent
8ac71a6127
commit
6541ce633e
4 changed files with 34 additions and 2 deletions
|
|
@ -865,6 +865,12 @@ def test_row(app_client):
|
|||
assert [{'id': '1', 'content': 'hello'}] == response.json['rows']
|
||||
|
||||
|
||||
def test_row_strange_table_name(app_client):
|
||||
response = app_client.get('/fixtures/table%2Fwith%2Fslashes.csv/3.json?_shape=objects')
|
||||
assert response.status == 200
|
||||
assert [{'pk': '3', 'content': 'hey'}] == response.json['rows']
|
||||
|
||||
|
||||
def test_row_foreign_key_tables(app_client):
|
||||
response = app_client.get('/fixtures/simple_primary_key/1.json?_extras=foreign_key_tables')
|
||||
assert response.status == 200
|
||||
|
|
|
|||
|
|
@ -56,6 +56,19 @@ def test_row(app_client):
|
|||
assert response.status == 200
|
||||
|
||||
|
||||
def test_row_strange_table_name(app_client):
|
||||
response = app_client.get(
|
||||
'/fixtures/table%2Fwith%2Fslashes.csv/3',
|
||||
allow_redirects=False
|
||||
)
|
||||
assert response.status == 302
|
||||
assert response.headers['Location'].endswith(
|
||||
'/table%2Fwith%2Fslashes.csv/3'
|
||||
)
|
||||
response = app_client.get('/fixtures/table%2Fwith%2Fslashes.csv/3')
|
||||
assert response.status == 200
|
||||
|
||||
|
||||
def test_add_filter_redirects(app_client):
|
||||
filter_args = urllib.parse.urlencode({
|
||||
'_filter_column': 'content',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue