mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Added template_debug setting, closes #654
This commit is contained in:
parent
ceef5ce684
commit
d54318fc7f
6 changed files with 61 additions and 23 deletions
|
|
@ -1287,6 +1287,7 @@ def test_config_json(app_client):
|
|||
"truncate_cells_html": 2048,
|
||||
"force_https_urls": False,
|
||||
"hash_urls": False,
|
||||
"template_debug": False,
|
||||
} == response.json
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1073,3 +1073,16 @@ def test_zero_results(app_client, path):
|
|||
soup = Soup(response.text, "html.parser")
|
||||
assert 0 == len(soup.select("table"))
|
||||
assert 1 == len(soup.select("p.zero-results"))
|
||||
|
||||
|
||||
def test_config_template_debug_on():
|
||||
for client in make_app_client(config={"template_debug": True}):
|
||||
response = client.get("/fixtures/facetable?_context=1")
|
||||
assert response.status == 200
|
||||
assert response.text.startswith("<pre>{")
|
||||
|
||||
|
||||
def test_config_template_debug_off(app_client):
|
||||
response = app_client.get("/fixtures/facetable?_context=1")
|
||||
assert response.status == 200
|
||||
assert not response.text.startswith("<pre>{")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue