mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Ported app_client to ds_client where possible in test_auth.py, refs #1959
This commit is contained in:
parent
b077e63dc6
commit
425ac4357f
6 changed files with 91 additions and 67 deletions
|
|
@ -1718,6 +1718,10 @@ class DatasetteClient:
|
|||
self.ds = ds
|
||||
self.app = ds.app()
|
||||
|
||||
def actor_cookie(self, actor):
|
||||
# Utility method, mainly for tests
|
||||
return self.ds.sign({"a": actor}, "actor")
|
||||
|
||||
def _fix(self, path, avoid_path_rewrites=False):
|
||||
if not isinstance(path, PrefixedUrlString) and not avoid_path_rewrites:
|
||||
path = self.ds.urls.path(path)
|
||||
|
|
|
|||
|
|
@ -28,13 +28,6 @@ class TestResponse:
|
|||
def cookies(self):
|
||||
return dict(self.httpx_response.cookies)
|
||||
|
||||
def cookie_was_deleted(self, cookie):
|
||||
return any(
|
||||
h
|
||||
for h in self.httpx_response.headers.get_list("set-cookie")
|
||||
if h.startswith(f'{cookie}="";')
|
||||
)
|
||||
|
||||
@property
|
||||
def json(self):
|
||||
return json.loads(self.text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue