Commit 649516e2 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Cookies class is a dict-like object


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@44969 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0f418a83
......@@ -205,20 +205,20 @@ class Browser(ExtendedTestBrowser):
logging.info("Opening url: " + absolute_url)
super(Browser, self).open(absolute_url, data)
def getCookieValue(self, cookie_name, default=None):
def getCookieValue(self, name, default=None):
"""
Get the cookie value of the given cookie name.
@param cookie_name: Name of the cookie
@type cookie_name: str
@param name: Name of the cookie
@type name: str
@param default: Fallback value if the cookie was not found
@type default: str
@return: Cookie value
@rtype: str
"""
for cookie in self.cookies:
if cookie_name == cookie.name:
return cookie.value
for cookie_name, cookie_value in self.cookies.iteritems():
if name == cookie_name:
return cookie_value
return default
......
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