From 54fb1de5d27b260e440010cb191ec2fd0204cbe6 Mon Sep 17 00:00:00 2001 From: ante Date: Sat, 3 Jan 2015 17:29:17 +0100 Subject: [PATCH] Python 3 fixes --- rest_auth/tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_auth/tests.py b/rest_auth/tests.py index 1134940..ebfc704 100644 --- a/rest_auth/tests.py +++ b/rest_auth/tests.py @@ -64,7 +64,7 @@ class BaseAPITestCase(object): is_json = bool( filter(lambda x: 'json' in x, self.response._headers['content-type'])) if is_json and self.response.content: - self.response.json = json.loads(self.response.content) + self.response.json = json.loads(self.response.content.decode()) else: self.response.json = {} if status_code: @@ -176,7 +176,7 @@ class APITestCase1(TestCase, BaseAPITestCase): result['uid'] = int_to_base36(user.pk) else: from django.utils.http import urlsafe_base64_encode - result['uid'] = urlsafe_base64_encode(force_bytes(user.pk)) + result['uid'] = urlsafe_base64_encode(force_bytes(user.pk)).decode() result['token'] = default_token_generator.make_token(user) return result