Encode id_token in tests.
This commit is contained in:
parent
4485453803
commit
401a35f68f
1 changed files with 3 additions and 3 deletions
|
@ -153,7 +153,7 @@ class TokenTestCase(TestCase):
|
||||||
response = self._post_request(post_data)
|
response = self._post_request(post_data)
|
||||||
|
|
||||||
response_dic = json.loads(response.content.decode('utf-8'))
|
response_dic = json.loads(response.content.decode('utf-8'))
|
||||||
id_token = JWT().unpack(response_dic['id_token']).payload()
|
id_token = JWT().unpack(response_dic['id_token'].encode('utf-8')).payload()
|
||||||
|
|
||||||
self.assertEqual(id_token.get('nonce'), FAKE_NONCE)
|
self.assertEqual(id_token.get('nonce'), FAKE_NONCE)
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ class TokenTestCase(TestCase):
|
||||||
response = self._post_request(post_data)
|
response = self._post_request(post_data)
|
||||||
response_dic = json.loads(response.content.decode('utf-8'))
|
response_dic = json.loads(response.content.decode('utf-8'))
|
||||||
|
|
||||||
id_token = JWT().unpack(response_dic['id_token']).payload()
|
id_token = JWT().unpack(response_dic['id_token'].encode('utf-8')).payload()
|
||||||
|
|
||||||
self.assertEqual(id_token.get('nonce'), None)
|
self.assertEqual(id_token.get('nonce'), None)
|
||||||
|
|
||||||
|
@ -189,4 +189,4 @@ class TokenTestCase(TestCase):
|
||||||
response = self._post_request(post_data)
|
response = self._post_request(post_data)
|
||||||
response_dic = json.loads(response.content.decode('utf-8'))
|
response_dic = json.loads(response.content.decode('utf-8'))
|
||||||
|
|
||||||
id_token = JWS().verify_compact(response_dic['id_token'], RSAKEYS)
|
id_token = JWS().verify_compact(response_dic['id_token'].encode('utf-8'), RSAKEYS)
|
||||||
|
|
Loading…
Reference in a new issue