Commit b2011790 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

testERP5AccessToken py3

parent d56cc014
...@@ -148,7 +148,7 @@ class TestERP5AccessTokenSkins(AccessTokenTestCase): ...@@ -148,7 +148,7 @@ class TestERP5AccessTokenSkins(AccessTokenTestCase):
# that's not ideal. # that's not ideal.
self.assertEqual( self.assertEqual(
response.getBody(), response.getBody(),
'erp5_access_token_plugin=%s' % access_token.getRelativeUrl()) ('erp5_access_token_plugin=%s' % access_token.getRelativeUrl()).encode())
def test_bad_token(self): def test_bad_token(self):
person = self._createPerson(self.new_id) person = self._createPerson(self.new_id)
...@@ -441,7 +441,7 @@ class TestERP5DumbHTTPExtractionPlugin(AccessTokenTestCase): ...@@ -441,7 +441,7 @@ class TestERP5DumbHTTPExtractionPlugin(AccessTokenTestCase):
return HTTPRequest(StringIO(), env, HTTPResponse()) return HTTPRequest(StringIO(), env, HTTPResponse())
def test_working_authentication(self): def test_working_authentication(self):
request = self.do_fake_request("GET", {"HTTP_AUTHORIZATION": "Basic " + base64.b64encode("login:password")}) request = self.do_fake_request("GET", {"HTTP_AUTHORIZATION": b"Basic " + base64.b64encode(b"login:password")})
ret = ERP5DumbHTTPExtractionPlugin("default_extraction").extractCredentials(request) ret = ERP5DumbHTTPExtractionPlugin("default_extraction").extractCredentials(request)
self.assertEqual(ret, {'login': 'login', 'password': 'password', 'remote_host': 'bobo.remote.host', 'remote_address': '204.183.226.81 '}) self.assertEqual(ret, {'login': 'login', 'password': 'password', 'remote_host': 'bobo.remote.host', 'remote_address': '204.183.226.81 '})
......
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