mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Flash messages mechanism, closes #790
This commit is contained in:
parent
1d0bea157a
commit
4fa7cf6853
14 changed files with 217 additions and 7 deletions
|
|
@ -29,6 +29,12 @@ class TestResponse:
|
|||
self.headers = headers
|
||||
self.body = body
|
||||
|
||||
@property
|
||||
def cookies(self):
|
||||
cookie = SimpleCookie()
|
||||
cookie.load(self.headers.get("set-cookie") or "")
|
||||
return {key: value.value for key, value in cookie.items()}
|
||||
|
||||
@property
|
||||
def json(self):
|
||||
return json.loads(self.text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue