Got a couple more test to pass

issue-1657-wip
Simon Willison 2022-03-15 08:31:10 -07:00
rodzic 5c02664e4a
commit f33c900191
2 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -453,7 +453,7 @@ class DataView(BaseView):
# _format may be in <as_format> captured by the URL router # _format may be in <as_format> captured by the URL router
as_format = kwargs.pop("as_format", None) as_format = kwargs.pop("as_format", None)
if as_format: if as_format:
_format = as_format _format = as_format.lstrip(".")
else: else:
# If there's a '.' in the last portion of the path, use that as format: # If there's a '.' in the last portion of the path, use that as format:
last_path_component = request.path.split("/")[-1] last_path_component = request.path.split("/")[-1]

Wyświetl plik

@ -681,7 +681,7 @@ def test_row(app_client):
def test_row_strange_table_name(app_client): def test_row_strange_table_name(app_client):
response = app_client.get( response = app_client.get(
"/fixtures/table-2Fwith-2Fslashes-2Ecsv/3.json?_shape=objects" "/fixtures/table~2Fwith~2Fslashes~2Ecsv/3.json?_shape=objects"
) )
assert response.status == 200 assert response.status == 200
assert [{"pk": "3", "content": "hey"}] == response.json["rows"] assert [{"pk": "3", "content": "hey"}] == response.json["rows"]