mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 04:28:25 -04:00
more fixes
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import urllib
|
||||
|
||||
import pytest
|
||||
from itsdangerous import BadSignature, SignatureExpired
|
||||
from pytest import fail
|
||||
|
||||
from notifications_utils.url_safe_token import check_token, generate_token
|
||||
|
||||
@@ -19,7 +18,7 @@ def test_should_throw_exception_when_token_is_tampered_with():
|
||||
token = generate_token(str(uuid.uuid4()), "secret-key", "dangerous-salt")
|
||||
try:
|
||||
check_token(token + "qerqwer", "secret-key", "dangerous-salt", 30)
|
||||
fail()
|
||||
pytest.fail("Expected a BadSignature")
|
||||
except BadSignature:
|
||||
pass
|
||||
|
||||
@@ -31,6 +30,6 @@ def test_return_none_when_token_is_expired():
|
||||
token = urllib.parse.unquote(token)
|
||||
try:
|
||||
assert check_token(token, "secret-key", "dangerous-salt", max_age) is None
|
||||
fail("Expected a SignatureExpired exception")
|
||||
pytest.fail("Expected a SignatureExpired exception")
|
||||
except SignatureExpired:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user