Commit 8e192c2d authored by Jérome Perrin's avatar Jérome Perrin

core_test: testAutoLogout py3

parent d18306f5
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
############################################################################## ##############################################################################
from functools import partial from functools import partial
from six.moves import cStringIO as StringIO import io
import unittest import unittest
from six.moves.urllib.parse import urlencode from six.moves.urllib.parse import urlencode
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
...@@ -85,8 +85,8 @@ class TestAuoLogout(ERP5TypeTestCase): ...@@ -85,8 +85,8 @@ class TestAuoLogout(ERP5TypeTestCase):
portal.absolute_url_path() + '/view', portal.absolute_url_path() + '/view',
request_method='POST', request_method='POST',
) )
response = publish(stdin=StringIO(stdin)) response = publish(stdin=io.BytesIO(stdin.encode()))
self.assertIn('Welcome to ERP5', response.getBody()) self.assertIn(b'Welcome to ERP5', response.getBody())
# check '__ac' cookie has set an expire timeout # check '__ac' cookie has set an expire timeout
ac_cookie = response.getCookie('__ac') ac_cookie = response.getCookie('__ac')
...@@ -100,8 +100,8 @@ class TestAuoLogout(ERP5TypeTestCase): ...@@ -100,8 +100,8 @@ class TestAuoLogout(ERP5TypeTestCase):
self.tic() self.tic()
portal.portal_caches.clearAllCache() portal.portal_caches.clearAllCache()
response = publish(stdin=StringIO(stdin)) response = publish(stdin=io.BytesIO(stdin.encode()))
self.assertIn('Welcome to ERP5', response.getBody()) self.assertIn(b'Welcome to ERP5', response.getBody())
ac_cookie = response.getCookie('__ac') ac_cookie = response.getCookie('__ac')
self.assertNotEqual(ac_cookie, None) self.assertNotEqual(ac_cookie, None)
self.assertEqual(ac_cookie.get(normalizeCookieParameterName('expires'), None), None) self.assertEqual(ac_cookie.get(normalizeCookieParameterName('expires'), None), None)
......
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