kopia lustrzana https://github.com/simonw/datasette
Fix broken CSV/JSON export on query page, refs #1010
rodzic
c13d184704
commit
9f6dd985bc
|
@ -58,7 +58,7 @@
|
|||
</form>
|
||||
|
||||
{% if display_rows %}
|
||||
<p class="export-links">This data as {% for name, url in renderers.items() %}<a href="{{ base_url }}{{ url }}">{{ name }}</a>{{ ", " if not loop.last }}{% endfor %}, <a href="{{ base_url }}{{ url_csv }}">CSV</a></p>
|
||||
<p class="export-links">This data as {% for name, url in renderers.items() %}<a href="{{ url }}">{{ name }}</a>{{ ", " if not loop.last }}{% endfor %}, <a href="{{ url_csv }}">CSV</a></p>
|
||||
<table class="rows-and-columns">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
|
@ -672,6 +672,13 @@ def test_row_json_export_link(app_client):
|
|||
assert '<a href="/fixtures/simple_primary_key/1.json">json</a>' 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 '<a href="/fixtures.json?sql=select+1">json</a>' in response.text
|
||||
assert '<a href="/fixtures.csv?sql=select+1&_size=max">CSV</a>' 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
|
||||
|
|
Ładowanie…
Reference in New Issue