kopia lustrzana https://github.com/simonw/datasette
rodzic
8050f9e1ec
commit
f4c0830529
|
@ -362,6 +362,8 @@ class DataView(BaseView):
|
|||
_format = request.args.get("_format", None)
|
||||
if not _format:
|
||||
_format = (args.pop("as_format", None) or "").lstrip(".")
|
||||
else:
|
||||
args.pop("as_format", None)
|
||||
if "table_and_format" in args:
|
||||
db = self.ds.databases[database]
|
||||
|
||||
|
|
|
@ -1107,6 +1107,15 @@ def test_row(app_client):
|
|||
assert [{"id": "1", "content": "hello"}] == response.json["rows"]
|
||||
|
||||
|
||||
def test_row_format_in_querystring(app_client):
|
||||
# regression test for https://github.com/simonw/datasette/issues/563
|
||||
response = app_client.get(
|
||||
"/fixtures/simple_primary_key/1?_format=json&_shape=objects"
|
||||
)
|
||||
assert response.status == 200
|
||||
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"
|
||||
|
|
Ładowanie…
Reference in New Issue