Skip to content

Commit

Permalink
Test InvalidTokenError, audience missing
Browse files Browse the repository at this point in the history
  • Loading branch information
mongkok committed Jan 7, 2018
1 parent 3a65db8 commit aba924d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ def test_payload_expired_signature(self):
with self.assertRaises(GraphQLJWTError):
utils.get_payload(token)

def test_payload_decoding_error(self):
def test_payload_decode_audience_missing(self):
payload = utils.jwt_payload(self.user)
token = utils.jwt_encode(payload)

with override_settings(JWT_AUDIENCE='test'):
with self.assertRaises(GraphQLJWTError):
utils.get_payload(token)

def test_payload_decode_error(self):
with self.assertRaises(GraphQLJWTError):
utils.get_payload('invalid')

Expand Down

0 comments on commit aba924d

Please sign in to comment.