From 3ac0b98a980a930ec9e6a6d4d364eb8af505a77c Mon Sep 17 00:00:00 2001 From: Cuidight Heach Date: Sun, 10 Mar 2013 20:36:47 +0200 Subject: Python 3 compatible string handling --- pyramid/tests/test_authentication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyramid/tests/test_authentication.py b/pyramid/tests/test_authentication.py index c9313e0c6..e696a5754 100644 --- a/pyramid/tests/test_authentication.py +++ b/pyramid/tests/test_authentication.py @@ -1290,12 +1290,12 @@ class TestBasicAuthAuthenticationPolicy(unittest.TestCase): def test_authenticated_userid_utf8(self): import base64 request = testing.DummyRequest() - inputs = u'm\xf6rk\xf6:m\xf6rk\xf6password' + inputs = 'm\xc3\xb6rk\xc3\xb6:m\xc3\xb6rk\xc3\xb6password'.decode('utf-8') request.headers['Authorization'] = 'Basic %s' % base64.b64encode(inputs.encode('utf-8')) def check(username, password, request): return [] policy = self._makeOne(check) - self.assertEqual(policy.authenticated_userid(request), u'm\xf6rk\xf6') + self.assertEqual(policy.authenticated_userid(request), 'm\xc3\xb6rk\xc3\xb6'.decode('utf-8')) def test_unauthenticated_userid_invalid_payload(self): import base64 -- cgit v1.2.3