summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCuidight Heach <cuidighth@gmail.com>2013-03-10 20:36:47 +0200
committerCuidight Heach <cuidighth@gmail.com>2013-03-10 20:36:47 +0200
commit3ac0b98a980a930ec9e6a6d4d364eb8af505a77c (patch)
tree205b738a32c95d7cfbe38dd44aa62a18358a0795
parent5cc157a749d4720144f4156c1d9fbd673e1dc68d (diff)
downloadpyramid-3ac0b98a980a930ec9e6a6d4d364eb8af505a77c.tar.gz
pyramid-3ac0b98a980a930ec9e6a6d4d364eb8af505a77c.tar.bz2
pyramid-3ac0b98a980a930ec9e6a6d4d364eb8af505a77c.zip
Python 3 compatible string handling
-rw-r--r--pyramid/tests/test_authentication.py4
1 files 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