Remove sender module, code was moved to api.

This commit is contained in:
Rebecca Law
2016-03-13 09:39:29 +00:00
parent 9d2fbca557
commit 34e7d21855
2 changed files with 0 additions and 56 deletions

View File

@@ -1,29 +0,0 @@
from itsdangerous import BadSignature
from pytest import fail
from app.notify_client.sender import generate_token, check_token
def test_should_return_email_from_signed_token(app_):
email = 'email@something.com'
token = generate_token(email)
assert email == check_token(token)
def test_should_throw_exception_when_token_is_tampered_with(app_):
email = 'email@something.com'
token = generate_token(email)
try:
check_token(token + 'qerqwer')
fail()
except BadSignature:
pass
def test_return_none_when_token_is_expired(app_):
with app_.test_request_context():
app_.config['TOKEN_MAX_AGE_SECONDS'] = -1000
email = 'email@something.com'
token = generate_token(email)
assert check_token(token) is None
app_.config['TOKEN_MAX_AGE_SECONDS'] = 120000