mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Port app_client to ds_client for most of test_html.py, refs #1959
This commit is contained in:
parent
3001eec66a
commit
95900b9d02
2 changed files with 252 additions and 162 deletions
|
|
@ -16,6 +16,11 @@ class TestResponse:
|
|||
def status(self):
|
||||
return self.httpx_response.status_code
|
||||
|
||||
# Supports both for test-writing convenience
|
||||
@property
|
||||
def status_code(self):
|
||||
return self.status
|
||||
|
||||
@property
|
||||
def headers(self):
|
||||
return self.httpx_response.headers
|
||||
|
|
@ -24,6 +29,10 @@ class TestResponse:
|
|||
def body(self):
|
||||
return self.httpx_response.content
|
||||
|
||||
@property
|
||||
def content(self):
|
||||
return self.body
|
||||
|
||||
@property
|
||||
def cookies(self):
|
||||
return dict(self.httpx_response.cookies)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue