mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
improvements
This commit is contained in:
@@ -143,7 +143,6 @@ class Request:
|
||||
cookies = RequestsCookieJar()
|
||||
cookie_header = self.headers.get("cookie", "")
|
||||
|
||||
# if cookie_header:
|
||||
bc = SimpleCookie(cookie_header)
|
||||
for k, v in bc.items():
|
||||
cookies[k] = v
|
||||
|
||||
@@ -396,4 +396,12 @@ def test_sessions(api, session):
|
||||
|
||||
r = session.get(api.url_for(view))
|
||||
assert r.cookies['Responder-Session'] == '{"hello": "world"}.lJVWJULPqR9kdao_oT4pUglV281bxHfGvcKQ7XF8qNqaiIZlRcMvqKNdA1-d5z7DycAx5eqmzJZoqWPP759-Cw'
|
||||
assert r.json() == {"hello": "world"}
|
||||
assert r.json() == {"hello": "world"}
|
||||
|
||||
def test_template_rendering(api, session):
|
||||
@api.route('/')
|
||||
def view(req, resp):
|
||||
resp.content = api.template_string("{{ var }}", var="hello")
|
||||
|
||||
r = session.get(api.url_for(view))
|
||||
assert r.text == "hello"
|
||||
|
||||
Reference in New Issue
Block a user