mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_trace=1 now depends on trace_debug setting, closes #1359
This commit is contained in:
parent
368aa5f1b1
commit
ff29dd55fa
7 changed files with 69 additions and 26 deletions
|
|
@ -3,6 +3,7 @@ from .fixtures import ( # noqa
|
|||
app_client,
|
||||
app_client_csv_max_mb_one,
|
||||
app_client_with_cors,
|
||||
app_client_with_trace,
|
||||
)
|
||||
|
||||
EXPECTED_TABLE_CSV = """id,content
|
||||
|
|
@ -160,8 +161,8 @@ def test_table_csv_stream(app_client):
|
|||
assert 1002 == len([b for b in response.body.split(b"\r\n") if b])
|
||||
|
||||
|
||||
def test_csv_trace(app_client):
|
||||
response = app_client.get("/fixtures/simple_primary_key.csv?_trace=1")
|
||||
def test_csv_trace(app_client_with_trace):
|
||||
response = app_client_with_trace.get("/fixtures/simple_primary_key.csv?_trace=1")
|
||||
assert response.headers["content-type"] == "text/html; charset=utf-8"
|
||||
soup = Soup(response.text, "html.parser")
|
||||
assert (
|
||||
|
|
@ -171,13 +172,13 @@ def test_csv_trace(app_client):
|
|||
assert "select id, content from simple_primary_key" in soup.find("pre").text
|
||||
|
||||
|
||||
def test_table_csv_stream_does_not_calculate_facets(app_client):
|
||||
response = app_client.get("/fixtures/simple_primary_key.csv?_trace=1")
|
||||
def test_table_csv_stream_does_not_calculate_facets(app_client_with_trace):
|
||||
response = app_client_with_trace.get("/fixtures/simple_primary_key.csv?_trace=1")
|
||||
soup = Soup(response.text, "html.parser")
|
||||
assert "select content, count(*) as n" not in soup.find("pre").text
|
||||
|
||||
|
||||
def test_table_csv_stream_does_not_calculate_counts(app_client):
|
||||
response = app_client.get("/fixtures/simple_primary_key.csv?_trace=1")
|
||||
def test_table_csv_stream_does_not_calculate_counts(app_client_with_trace):
|
||||
response = app_client_with_trace.get("/fixtures/simple_primary_key.csv?_trace=1")
|
||||
soup = Soup(response.text, "html.parser")
|
||||
assert "select count(*)" not in soup.find("pre").text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue