# Path: notifications_utils/url_safe_token.py
# def check_token(token, secret, salt, max_age_seconds):
#     ser = URLSafeTimedSerializer(secret)
#     payload = ser.loads(token, max_age=max_age_seconds,
#                         salt=salt)
#     return payload
# 
# def generate_token(payload, secret, salt):
#     return url_encode_full_stops(
#         URLSafeTimedSerializer(secret).dumps(payload, salt)
#     )


import urllib
    import uuid
from itsdangerous import BadSignature, SignatureExpired
from pytest import fail
from notifications_utils.url_safe_token import check_token, generate_token




def test_should_return_payload_from_signed_token():
    payload = 'email@something.com'
    token = generate_token(payload, 'secret-key', 'dangerous-salt')
    token = urllib.parse.unquote(token)

# Path: notifications_utils/url_safe_token.py
# def check_token(token, secret, salt, max_age_seconds):
#     ser = URLSafeTimedSerializer(secret)
#     payload = ser.loads(token, max_age=max_age_seconds,
#                         salt=salt)
#     return payload
# 
# def generate_token(payload, secret, salt):
#     return url_encode_full_stops(
#         URLSafeTimedSerializer(secret).dumps(payload, salt)
#     )


# Path: tests/test_url_safe_tokens.py
import urllib
    import uuid
from itsdangerous import BadSignature, SignatureExpired
from pytest import fail
from notifications_utils.url_safe_token import check_token, generate_token





def test_should_return_payload_from_signed_token():
    payload = 'email@something.com'
    token = generate_token(payload, 'secret-key', 'dangerous-salt')
    token = urllib.parse.unquote(token)

    assert payload == check_token(token, 'secret-key', 'dangerous-salt', 30)