.csv now links to .blob downloads

Closes #1063, closes #1034
This commit is contained in:
Simon Willison 2020-10-29 15:47:32 -07:00
commit 178b7e8749
4 changed files with 65 additions and 13 deletions

View file

@ -386,6 +386,14 @@ def test_path_with_format(path, format, extra_qs, expected):
assert expected == actual
def test_path_with_format_replace_format():
request = Request.fake("/foo/bar.csv")
assert utils.path_with_format(request, "blob") == "/foo/bar.csv?_format=blob"
assert (
utils.path_with_format(request, "blob", replace_format="csv") == "/foo/bar.blob"
)
@pytest.mark.parametrize(
"bytes,expected",
[