Commit bfd3a21b authored by Jérome Perrin's avatar Jérome Perrin

dms: pylint on py3

parent 0655e45c
...@@ -1737,6 +1737,7 @@ return True ...@@ -1737,6 +1737,7 @@ return True
response = requests.get( response = requests.get(
self.portal.absolute_url(), self.portal.absolute_url(),
cookies=auth_cookie, cookies=auth_cookie,
timeout=10,
) )
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Cache-Control'], 'private') self.assertEqual(response.headers['Cache-Control'], 'private')
...@@ -1745,6 +1746,7 @@ return True ...@@ -1745,6 +1746,7 @@ return True
response = requests.get( response = requests.get(
'%s/%s' % (website.absolute_url(), 'released_page'), '%s/%s' % (website.absolute_url(), 'released_page'),
cookies=auth_cookie, cookies=auth_cookie,
timeout=10,
) )
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Cache-Control'], 'max-age=0, no-store') self.assertEqual(response.headers['Cache-Control'], 'max-age=0, no-store')
...@@ -1753,6 +1755,7 @@ return True ...@@ -1753,6 +1755,7 @@ return True
response = requests.get( response = requests.get(
'%s/%s?format=txt' % (website.absolute_url(), 'released_page'), '%s/%s?format=txt' % (website.absolute_url(), 'released_page'),
cookies=auth_cookie, cookies=auth_cookie,
timeout=10,
) )
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Cache-Control'], 'max-age=0, no-store') self.assertEqual(response.headers['Cache-Control'], 'max-age=0, no-store')
...@@ -1760,12 +1763,14 @@ return True ...@@ -1760,12 +1763,14 @@ return True
# published page # published page
response = requests.get( response = requests.get(
'%s/%s' % (website.absolute_url(), 'published_page'), '%s/%s' % (website.absolute_url(), 'published_page'),
timeout=10,
) )
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Cache-Control'], 'max-age=600, stale-while-revalidate=360000, public') self.assertEqual(response.headers['Cache-Control'], 'max-age=600, stale-while-revalidate=360000, public')
response = requests.get( response = requests.get(
'%s/%s' % (website.absolute_url(), 'published_page'), '%s/%s' % (website.absolute_url(), 'published_page'),
cookies=auth_cookie, cookies=auth_cookie,
timeout=10,
) )
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Cache-Control'], 'max-age=0, no-store') self.assertEqual(response.headers['Cache-Control'], 'max-age=0, no-store')
...@@ -1773,12 +1778,14 @@ return True ...@@ -1773,12 +1778,14 @@ return True
# converted published page # converted published page
response = requests.get( response = requests.get(
'%s/%s?format=txt' % (website.absolute_url(), 'published_page'), '%s/%s?format=txt' % (website.absolute_url(), 'published_page'),
timeout=10,
) )
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Cache-Control'], 'max-age=600, stale-while-revalidate=360000, public') self.assertEqual(response.headers['Cache-Control'], 'max-age=600, stale-while-revalidate=360000, public')
response = requests.get( response = requests.get(
'%s/%s?format=txt' % (website.absolute_url(), 'published_page'), '%s/%s?format=txt' % (website.absolute_url(), 'published_page'),
cookies=auth_cookie, cookies=auth_cookie,
timeout=10,
) )
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(response.headers['Cache-Control'], 'max-age=600, stale-while-revalidate=360000, public') self.assertEqual(response.headers['Cache-Control'], 'max-age=600, stale-while-revalidate=360000, public')
......
...@@ -4,6 +4,6 @@ i=u.find('://') ...@@ -4,6 +4,6 @@ i=u.find('://')
if i>-1: if i>-1:
prot=u[:i] prot=u[:i]
if prot not in o.getProtocolList(): if prot not in o.getProtocolList():
raise Exception("Protocol "+prot+" not supported") raise ValueError("Protocol "+prot+" not supported")
o.setUrlString(u[i+3:]) o.setUrlString(u[i+3:])
o.setUrlProtocol(prot) o.setUrlProtocol(prot)
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