diff options
| author | Xavier Ordoquy | 2012-11-22 00:20:49 +0100 |
|---|---|---|
| committer | Xavier Ordoquy | 2012-11-22 00:20:49 +0100 |
| commit | b3698acb6c0b9eaa04189599e27014c788a75adc (patch) | |
| tree | 25de3a90ca99b6de980ce0c4031ffb512d9f9c00 /rest_framework/tests/authentication.py | |
| parent | ab3c47297481b7a4ff66027618f9c05bf02a2204 (diff) | |
| download | django-rest-framework-b3698acb6c0b9eaa04189599e27014c788a75adc.tar.bz2 | |
First passing test under p3k \o/
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 96ca9f52..c6b4aedc 100644 --- a/rest_framework/tests/authentication.py +++ b/rest_framework/tests/authentication.py @@ -44,7 +44,7 @@ class BasicAuthTests(TestCase): def test_post_form_passing_basic_auth(self): """Ensure POSTing json 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 ' + base64.encodestring(('%s:%s' % (self.username, self.password)).encode('utf8')).strip() response = self.csrf_client.post('/', {'example': 'example'}, HTTP_AUTHORIZATION=auth) self.assertEqual(response.status_code, 200) |
