converting unicode to byte where necessary

This commit is contained in:
jinder1s
2019-10-03 10:09:18 -04:00
parent 6c73361cf5
commit 2c6b2f32dd

View File

@@ -23,7 +23,7 @@ class ApiTestCase(TestCase):
"""
Returns a dictionary containing the http auth header with encoded username+password
"""
return {'HTTP_AUTHORIZATION': 'Basic ' + base64.b64encode('%s:%s' % (username, password))}
return {'HTTP_AUTHORIZATION': b'Basic ' + base64.b64encode(b'%s:%s' % (username.encode(), password.encode()))}
def request_with_auth(self, method, *args, **kwargs):
"""Issue a request to the given URI with the API key header"""