# Path: models/authentication_tokens.py
# class AuthenticationTokens(bases.BaseModel):
#     def __init__(self, *args, **kwargs):
#     def _expiration():
#     def _gen_token():
#     def get_by_token(cls, token):
# 
# Path: models/logins.py
# class Logins(bases.BaseModel):
#     def get_by_email(cls, email):
#     def is_valid_password(self, password):
#     def password(self):
#     def password(self, value):
#     def validate_email(self, key, address):  # pylint: disable=unused-argument,no-self-use
# 
# Path: models/profiles.py
# class Profiles(bases.BaseModel):
#     def get_by_email(cls, email):
#     def validate_email(self, key, address):  # pylint: disable=unused-argument,no-self-use


    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from sqlalchemy.exc import IntegrityError
from models import authentication_tokens as autht
from models import logins, profiles
    import sys
import datetime
import re
import warnings
import pytest
    :param models.db createdb: pytest fixture for database module
    :return list(str): List of tokens for AuthenticationTokens created.
    """
    createdb.connect()
    tokens = []
    data = ({'full_name': '24c6e6a4 960f1df1d6ac', 'email': '7d26@4f1b.a38e',
             'password': 'be4b80d3-a6f2-442e-b495-2161376423ab'},
            {'full_name': '8ad0c442 92728ef096a4', 'email': '6594@4fe0.8d07',
             'password': 'b72da3ad-9b28-4be1-b9b0-9d611d465c31'},
            {'full_name': '5a61452b 2830a9f8c820', 'email': 'a26d@433d.be92',
             'password': '69073f4c-6328-47de-80c5-ab09016c69aa'})
    for record in data:
        profile = profiles.Profiles(full_name=record['full_name'], email=record['email'])
        login = logins.Logins(password=record['password'], profile=profile)
        token = autht.AuthenticationTokens(login=login)
        createdb.add(token)
        tokens.append(token.token)

    createdb.commit()
    createdb.close()
    return tokens

def test_gen_token():
    """ Should generate a token string matching the pattern. """
    tok_pttrn = re.compile(r'^[0-9a-f]{32}$')
    token = autht.AuthenticationTokens._gen_token()   # pylint: disable=protected-access
    assert tok_pttrn.match(token)

def test_expiration():
    """ Expiration should be 3 days from now. """

# Path: models/authentication_tokens.py
# class AuthenticationTokens(bases.BaseModel):
#     def __init__(self, *args, **kwargs):
#     def _expiration():
#     def _gen_token():
#     def get_by_token(cls, token):
# 
# Path: models/logins.py
# class Logins(bases.BaseModel):
#     def get_by_email(cls, email):
#     def is_valid_password(self, password):
#     def password(self):
#     def password(self, value):
#     def validate_email(self, key, address):  # pylint: disable=unused-argument,no-self-use
# 
# Path: models/profiles.py
# class Profiles(bases.BaseModel):
#     def get_by_email(cls, email):
#     def validate_email(self, key, address):  # pylint: disable=unused-argument,no-self-use


# Path: tests/models/test_authentication_tokens.py
    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from sqlalchemy.exc import IntegrityError
from models import authentication_tokens as autht
from models import logins, profiles
    import sys
import datetime
import re
import warnings
import pytest

    :param models.db createdb: pytest fixture for database module
    :return list(str): List of tokens for AuthenticationTokens created.
    """
    createdb.connect()
    tokens = []
    data = ({'full_name': '24c6e6a4 960f1df1d6ac', 'email': '7d26@4f1b.a38e',
             'password': 'be4b80d3-a6f2-442e-b495-2161376423ab'},
            {'full_name': '8ad0c442 92728ef096a4', 'email': '6594@4fe0.8d07',
             'password': 'b72da3ad-9b28-4be1-b9b0-9d611d465c31'},
            {'full_name': '5a61452b 2830a9f8c820', 'email': 'a26d@433d.be92',
             'password': '69073f4c-6328-47de-80c5-ab09016c69aa'})
    for record in data:
        profile = profiles.Profiles(full_name=record['full_name'], email=record['email'])
        login = logins.Logins(password=record['password'], profile=profile)
        token = autht.AuthenticationTokens(login=login)
        createdb.add(token)
        tokens.append(token.token)

    createdb.commit()
    createdb.close()
    return tokens

def test_gen_token():
    """ Should generate a token string matching the pattern. """
    tok_pttrn = re.compile(r'^[0-9a-f]{32}$')
    token = autht.AuthenticationTokens._gen_token()   # pylint: disable=protected-access
    assert tok_pttrn.match(token)

def test_expiration():
    """ Expiration should be 3 days from now. """

    exp_dt = autht.AuthenticationTokens._expiration().replace(microsecond=0)   # pylint: disable=protected-access