mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Modernize code to Python 3.6+ (#1158)
* Compact dict and set building * Remove redundant parentheses * Simplify chained conditions * Change method name to lowercase * Use triple double quotes for docstrings Thanks, @eumiro!
This commit is contained in:
parent
90eba4c3ca
commit
a882d67962
19 changed files with 76 additions and 82 deletions
|
|
@ -5,7 +5,7 @@ import time
|
|||
|
||||
|
||||
def test_auth_token(app_client):
|
||||
"The /-/auth-token endpoint sets the correct cookie"
|
||||
"""The /-/auth-token endpoint sets the correct cookie"""
|
||||
assert app_client.ds._root_token is not None
|
||||
path = f"/-/auth-token?token={app_client.ds._root_token}"
|
||||
response = app_client.get(
|
||||
|
|
@ -29,7 +29,7 @@ def test_auth_token(app_client):
|
|||
|
||||
|
||||
def test_actor_cookie(app_client):
|
||||
"A valid actor cookie sets request.scope['actor']"
|
||||
"""A valid actor cookie sets request.scope['actor']"""
|
||||
cookie = app_client.actor_cookie({"id": "test"})
|
||||
response = app_client.get("/", cookies={"ds_actor": cookie})
|
||||
assert {"id": "test"} == app_client.ds._last_request.scope["actor"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue