Working tests, hopefully all code changes done.

This commit is contained in:
Nicholas Staples
2016-01-27 12:22:32 +00:00
parent ce81a6f540
commit 6959d695d3
57 changed files with 1143 additions and 1578 deletions

View File

@@ -4,17 +4,13 @@ from pytest import fail
from app.notify_client.sender import generate_token, check_token
def test_should_return_email_from_signed_token(app_,
db_,
db_session):
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_,
db_,
db_session):
def test_should_throw_exception_when_token_is_tampered_with(app_):
email = 'email@something.com'
token = generate_token(email)
try:
@@ -24,9 +20,7 @@ def test_should_throw_exception_when_token_is_tampered_with(app_,
pass
def test_return_none_when_token_is_expired(app_,
db_,
db_session):
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'