diff options
| author | Xavier Ordoquy | 2012-11-22 02:08:00 +0100 |
|---|---|---|
| committer | Xavier Ordoquy | 2012-11-22 02:08:00 +0100 |
| commit | 606c20f012c5a1fdcfd661eb280bab22b94afcf5 (patch) | |
| tree | 9df0e343b9adc196ddd7e5fbc1b93e4c339260b2 /rest_framework/tests/authentication.py | |
| parent | 49f8e6419ad79a27c462eb4b0690f139ab8091de (diff) | |
| download | django-rest-framework-606c20f012c5a1fdcfd661eb280bab22b94afcf5.tar.bz2 | |
6 first tests passes under python 3.2
Diffstat (limited to 'rest_framework/tests/authentication.py')
| -rw-r--r-- | rest_framework/tests/authentication.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/tests/authentication.py b/rest_framework/tests/authentication.py index 90f86fee..b7cf5032 100644 --- a/rest_framework/tests/authentication.py +++ b/rest_framework/tests/authentication.py @@ -44,13 +44,13 @@ 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 = b'Basic ' + base64.encodestring(('%s:%s' % (self.username, self.password)).encode('utf8')).strip() + auth = 'Basic ' + base64.encodestring(('%s:%s' % (self.username, self.password)).encode('utf8')).strip().decode('utf8') response = self.csrf_client.post('/', {'example': 'example'}, HTTP_AUTHORIZATION=auth) self.assertEqual(response.status_code, 200) def test_post_json_passing_basic_auth(self): """Ensure POSTing form over basic auth with correct credentials passes and does not require CSRF""" - auth = b'Basic %s' % base64.encodestring(('%s:%s' % (self.username, self.password)).encode('utf8')).strip() + auth = 'Basic ' + base64.encodestring(('%s:%s' % (self.username, self.password)).encode('utf8')).strip().decode('utf8') response = self.csrf_client.post('/', json.dumps({'example': 'example'}), 'application/json', HTTP_AUTHORIZATION=auth) self.assertEqual(response.status_code, 200) |
