Port app_client to ds_client for most of test_html.py, refs #1959

This commit is contained in:
Simon Willison 2022-12-15 14:44:30 -08:00
commit 95900b9d02
2 changed files with 252 additions and 162 deletions

View file

@ -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)