Flash messages mechanism, closes #790

This commit is contained in:
Simon Willison 2020-06-02 14:08:12 -07:00
commit 4fa7cf6853
14 changed files with 217 additions and 7 deletions

View file

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