diff options
| author | Michael Merickel <michael@digitalartefacts.com> | 2013-10-19 02:54:19 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@digitalartefacts.com> | 2013-10-19 02:54:19 -0500 |
| commit | f0e57015af826c4c28f2d9df825b9b0355069285 (patch) | |
| tree | df076b272574199b00ae6d91d8ef68fc83c2f109 | |
| parent | 3acee31f86bcde8abbb4e63715afc5ca67976eaf (diff) | |
| parent | dc8533aad4d432817b52f158804f0b6a81fab374 (diff) | |
| download | pyramid-f0e57015af826c4c28f2d9df825b9b0355069285.tar.gz pyramid-f0e57015af826c4c28f2d9df825b9b0355069285.tar.bz2 pyramid-f0e57015af826c4c28f2d9df825b9b0355069285.zip | |
Merge branch 'master' of Cuidightheach/pyramid into fix.basic-authentication-encodings
| -rw-r--r-- | pyramid/tests/test_authentication.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pyramid/tests/test_authentication.py b/pyramid/tests/test_authentication.py index 6e9e3920d..19e95cf9a 100644 --- a/pyramid/tests/test_authentication.py +++ b/pyramid/tests/test_authentication.py @@ -1374,6 +1374,16 @@ class TestBasicAuthAuthenticationPolicy(unittest.TestCase): policy = self._makeOne(check) self.assertEqual(policy.authenticated_userid(request), 'chrisr') + def test_authenticated_userid_utf8(self): + import base64 + request = testing.DummyRequest() + inputs = b'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), b'm\xc3\xb6rk\xc3\xb6'.decode('utf-8')) + def test_unauthenticated_userid_invalid_payload(self): import base64 request = testing.DummyRequest() |
