type('') to str

This commit is contained in:
Nitesh Lohchab 2016-04-03 00:07:45 +05:30
parent 3d3b06447f
commit c22b92a66c

View File

@ -19,7 +19,7 @@ def get_authorization_header(request):
Hide some test client ickyness where the header can be unicode.
"""
auth = request.META.get('HTTP_AUTHORIZATION', b'')
if isinstance(auth, type('')):
if isinstance(auth, str):
# Work around django test client oddness
auth = auth.encode(HTTP_HEADER_ENCODING)
return auth