From 9f6dd985bc0eff70f8a9ce65c6578bc43d2e172b Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 9 Oct 2020 17:39:45 -0700 Subject: [PATCH] Fix broken CSV/JSON export on query page, refs #1010 --- datasette/templates/query.html | 2 +- tests/test_html.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/datasette/templates/query.html b/datasette/templates/query.html index 0add74a8..c6574f31 100644 --- a/datasette/templates/query.html +++ b/datasette/templates/query.html @@ -58,7 +58,7 @@ {% if display_rows %} - + diff --git a/tests/test_html.py b/tests/test_html.py index aca4eedd..3f8cb178 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -672,6 +672,13 @@ def test_row_json_export_link(app_client): assert 'json' in response.text +def test_query_json_csv_export_links(app_client): + response = app_client.get("/fixtures?sql=select+1") + assert response.status == 200 + assert 'json' in response.text + assert 'CSV' in response.text + + def test_csv_json_export_links_include_labels_if_foreign_keys(app_client): response = app_client.get("/fixtures/facetable") assert response.status == 200