def test_decode_expired_token():
in_the_past = NOW - timedelta(minutes=EXPIRY * 2 + 1)
with patch.object(_token.datetime, 'utcnow', return_value=in_the_past):
token, expiry = generate_token(CLIENT, SCOPE, 'grant_type')
with pytest.raises(jwt.ExpiredSignatureError):
decode_token(token)
评论列表
文章目录