Commit 17346560 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Zope4: response.cookies format is different in Zope >= 4.8.

parent d603304e
...@@ -464,12 +464,13 @@ class TestOAuth2(ERP5TypeTestCase): ...@@ -464,12 +464,13 @@ class TestOAuth2(ERP5TypeTestCase):
)) ))
if response.body: if response.body:
response.headers.setdefault('content-type', 'text/html; charset=utf-8') response.headers.setdefault('content-type', 'text/html; charset=utf-8')
# response.cookies can contain 'max_age': 0 in Zope < 4.8 but 'Max-Age': '0' in Zope >= 4.8.
return ( return (
response.status, response.status,
response_header_dict, response_header_dict,
{ {
name: ( name: (
cookie_dict if cookie_dict.get('max_age', True) else cookie_dict if cookie_dict.get('max_age', cookie_dict.get('Max-Age')) not in (0, '0') else
None None
) for name, cookie_dict in six.iteritems(cookie_dict) ) for name, cookie_dict in six.iteritems(cookie_dict)
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment