Show padlock on private database page, refs #811

This commit is contained in:
Simon Willison 2020-06-08 07:23:10 -07:00
commit 3ce7f2e7da
3 changed files with 14 additions and 1 deletions

View file

@ -43,10 +43,20 @@ def test_view_database(allow, expected_anon, expected_auth):
):
anon_response = client.get(path)
assert expected_anon == anon_response.status
if allow and path == "/fixtures" and anon_response.status == 200:
# Should be no padlock
assert ">fixtures 🔒</h1>" not in anon_response.text
auth_response = client.get(
path, cookies={"ds_actor": client.ds.sign({"id": "root"}, "actor")},
)
assert expected_auth == auth_response.status
if (
allow
and path == "/fixtures"
and expected_anon == 403
and expected_auth == 200
):
assert ">fixtures 🔒</h1>" in auth_response.text
def test_database_list_respects_view_database():