mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Show padlock on private index page, refs #811
This commit is contained in:
parent
cc218fa9be
commit
1cf86e5ecc
3 changed files with 10 additions and 1 deletions
|
|
@ -16,10 +16,16 @@ def test_view_instance(allow, expected_anon, expected_auth):
|
|||
):
|
||||
anon_response = client.get(path)
|
||||
assert expected_anon == anon_response.status
|
||||
if allow and path == "/" and anon_response.status == 200:
|
||||
# Should be no padlock
|
||||
assert "<h1>Datasette 🔒</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
|
||||
# Check for the padlock
|
||||
if allow and path == "/" and expected_anon == 403 and expected_auth == 200:
|
||||
assert "<h1>Datasette 🔒</h1>" in auth_response.text
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue