Add missing encode in test.
This commit is contained in:
parent
01bf1ee5e6
commit
162416bfae
1 changed files with 2 additions and 2 deletions
|
@ -182,11 +182,11 @@ class TokenTestCase(TestCase):
|
||||||
response_dic = json.loads(response.content.decode('utf-8'))
|
response_dic = json.loads(response.content.decode('utf-8'))
|
||||||
# Construct PEM key from exponent and modulus.
|
# Construct PEM key from exponent and modulus.
|
||||||
try:
|
try:
|
||||||
key_e = base64_to_long(response_dic['keys'][0]['e'])
|
key_e = base64_to_long(response_dic['keys'][0]['e'].encode('utf-8'))
|
||||||
key_e = long(key_e)
|
key_e = long(key_e)
|
||||||
except NameError:
|
except NameError:
|
||||||
key_e = int(key_e) # Python 3 support.
|
key_e = int(key_e) # Python 3 support.
|
||||||
key_n = base64_to_long(response_dic['keys'][0]['n'])
|
key_n = base64_to_long(response_dic['keys'][0]['n'].encode('utf-8'))
|
||||||
KEY = RSA.construct((key_n, key_e)).exportKey('PEM')
|
KEY = RSA.construct((key_n, key_e)).exportKey('PEM')
|
||||||
|
|
||||||
self.assertEqual(response_dic['keys'][0]['alg'] == 'RS256', True,
|
self.assertEqual(response_dic['keys'][0]['alg'] == 'RS256', True,
|
||||||
|
|
Loading…
Reference in a new issue