From ae9dcdef8a571c2653fc26440597511a078f51dd Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Fri, 11 Oct 2019 20:12:34 +0500 Subject: [PATCH] BOM-917 Fix encoding issue. --- openedx/core/lib/api/test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/core/lib/api/test_utils.py b/openedx/core/lib/api/test_utils.py index b2c116ac4d..93f25c9abb 100644 --- a/openedx/core/lib/api/test_utils.py +++ b/openedx/core/lib/api/test_utils.py @@ -86,6 +86,6 @@ class ApiTestCase(TestCase): # Django rest framework interprets basic auth headers # as an attempt to authenticate with the API. # We don't want this for views available to anonymous users. - basic_auth_header = "Basic " + base64.b64encode('username:password') + basic_auth_header = b"Basic " + base64.b64encode('username:password'.encode('utf-8')) response = getattr(self.client, method)(uri, HTTP_AUTHORIZATION=basic_auth_header) self.assertNotEqual(response.status_code, 403)