Add missing encode in test.

This commit is contained in:
juanifioren 2015-07-23 16:28:20 -03:00
parent 01bf1ee5e6
commit 162416bfae

View file

@ -182,11 +182,11 @@ class TokenTestCase(TestCase):
response_dic = json.loads(response.content.decode('utf-8'))
# Construct PEM key from exponent and modulus.
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)
except NameError:
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')
self.assertEqual(response_dic['keys'][0]['alg'] == 'RS256', True,