mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Upgrade to Black 20.8b1, closes #958
This commit is contained in:
parent
26b2922f17
commit
a648bb82ba
22 changed files with 203 additions and 58 deletions
|
|
@ -8,7 +8,10 @@ def test_auth_token(app_client):
|
|||
"The /-/auth-token endpoint sets the correct cookie"
|
||||
assert app_client.ds._root_token is not None
|
||||
path = "/-/auth-token?token={}".format(app_client.ds._root_token)
|
||||
response = app_client.get(path, allow_redirects=False,)
|
||||
response = app_client.get(
|
||||
path,
|
||||
allow_redirects=False,
|
||||
)
|
||||
assert 302 == response.status
|
||||
assert "/" == response.headers["Location"]
|
||||
assert {"a": {"id": "root"}} == app_client.ds.unsign(
|
||||
|
|
@ -16,7 +19,13 @@ def test_auth_token(app_client):
|
|||
)
|
||||
# Check that a second with same token fails
|
||||
assert app_client.ds._root_token is None
|
||||
assert 403 == app_client.get(path, allow_redirects=False,).status
|
||||
assert (
|
||||
403
|
||||
== app_client.get(
|
||||
path,
|
||||
allow_redirects=False,
|
||||
).status
|
||||
)
|
||||
|
||||
|
||||
def test_actor_cookie(app_client):
|
||||
|
|
@ -38,7 +47,11 @@ def test_actor_cookie_invalid(app_client):
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"offset,expected", [((24 * 60 * 60), {"id": "test"}), (-(24 * 60 * 60), None),]
|
||||
"offset,expected",
|
||||
[
|
||||
((24 * 60 * 60), {"id": "test"}),
|
||||
(-(24 * 60 * 60), None),
|
||||
],
|
||||
)
|
||||
def test_actor_cookie_that_expires(app_client, offset, expected):
|
||||
expires_at = int(time.time()) + offset
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue