diff options
| author | Xavier Ordoquy | 2012-11-22 00:32:00 +0100 |
|---|---|---|
| committer | Xavier Ordoquy | 2012-11-22 00:32:00 +0100 |
| commit | e9c8af46f18e95d67ca6e9fbe36c66dc8bbb1e6f (patch) | |
| tree | 0e39eb2c4c7aa1db3550bc5253c53845c1e95134 /rest_framework/tests/authentication.py | |
| parent | 80b95438df1c450de62fbea28b26fd91a0bf19d3 (diff) | |
| download | django-rest-framework-e9c8af46f18e95d67ca6e9fbe36c66dc8bbb1e6f.tar.bz2 | |
Fixed test with base64.
Diffstat (limited to 'rest_framework/tests/authentication.py')
| -rw-r--r-- | rest_framework/tests/authentication.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/tests/authentication.py b/rest_framework/tests/authentication.py index c6b4aedc..90f86fee 100644 --- a/rest_framework/tests/authentication.py +++ b/rest_framework/tests/authentication.py @@ -50,7 +50,7 @@ class BasicAuthTests(TestCase): def test_post_json_passing_basic_auth(self): """Ensure POSTing form over basic auth with correct credentials passes and does not require CSRF""" - auth = 'Basic %s' % base64.encodestring('%s:%s' % (self.username, self.password)).strip() + auth = b'Basic %s' % base64.encodestring(('%s:%s' % (self.username, self.password)).encode('utf8')).strip() response = self.csrf_client.post('/', json.dumps({'example': 'example'}), 'application/json', HTTP_AUTHORIZATION=auth) self.assertEqual(response.status_code, 200) |
