diff options
| author | José Padilla <jpadilla@webapplicate.com> | 2015-04-26 15:02:11 -0400 |
|---|---|---|
| committer | José Padilla <jpadilla@webapplicate.com> | 2015-04-26 15:02:11 -0400 |
| commit | 590f903ac78faaed348d4d5c5179964b345e41cb (patch) | |
| tree | f9826b677e9dcd6042ba021ebfe64e079dc706a2 /tests/test_api_jwt.py | |
| parent | 06deb9f3f385020170600370d6e456e11b63f704 (diff) | |
| download | pyjwt-bring-verify_expiration-back.tar.gz | |
`verify_expiration` was removed too soonbring-verify_expiration-back
- Merge with `verify_exp` option
- Add deprecation warning
Diffstat (limited to 'tests/test_api_jwt.py')
| -rw-r--r-- | tests/test_api_jwt.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_api_jwt.py b/tests/test_api_jwt.py index 8b2b852..4361d6e 100644 --- a/tests/test_api_jwt.py +++ b/tests/test_api_jwt.py @@ -419,3 +419,23 @@ class TestJWT: payload = jwt.decode(token, 'secret') assert payload == {'some_decimal': 'it worked'} + + def test_decode_with_verify_expiration_kwarg(self, jwt, payload): + payload['exp'] = utc_timestamp() - 1 + secret = 'secret' + jwt_message = jwt.encode(payload, secret) + + pytest.deprecated_call( + jwt.decode, + jwt_message, + secret, + verify_expiration=False + ) + + with pytest.raises(ExpiredSignatureError): + pytest.deprecated_call( + jwt.decode, + jwt_message, + secret, + verify_expiration=True + ) |
