Better titles for canned query pages, closes #887

This commit is contained in:
Simon Willison 2020-07-01 17:23:37 -07:00
commit 57879dc8b3
3 changed files with 10 additions and 3 deletions

View file

@ -179,13 +179,13 @@ def test_view_query(allow, expected_anon, expected_auth):
assert expected_anon == anon_response.status
if allow and anon_response.status == 200:
# Should be no padlock
assert ">fixtures 🔒</h1>" not in anon_response.text
assert "🔒</h1>" not in anon_response.text
auth_response = client.get(
"/fixtures/q", cookies={"ds_actor": client.actor_cookie({"id": "root"})}
)
assert expected_auth == auth_response.status
if allow and expected_anon == 403 and expected_auth == 200:
assert ">fixtures 🔒</h1>" in auth_response.text
assert ">fixtures: q 🔒</h1>" in auth_response.text
@pytest.mark.parametrize(