# Path: models/forgot_password_tokens.py
# class ForgotPasswordTokens(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 forgot_password_tokens as fpt
from models import logins, profiles
    import sys
import datetime
import re
import warnings
import pytest

    dbsession.commit()
    assert token.login == login

def test_get_by_token_blank(dbsession, testdata):  # pylint: disable=unused-argument,redefined-outer-name
    """
    Blanks shouldn't be found
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    :param list(str) testdata: pytest fixture listing test data tokens.
    """
    # Include testdata so we know there are at least some records in table to search
    assert fpt.ForgotPasswordTokens.get_by_token('') is None

def test_get_by_token_unknown(dbsession, testdata):  # pylint: disable=unused-argument,redefined-outer-name
    """
    Non-existing tokens shouldn't be found
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    :param list(str) testdata: pytest fixture listing test data tokens.
    """
    assert '159a5fdbe652476bbf7446183f0d787b' not in testdata
    assert fpt.ForgotPasswordTokens.get_by_token('159a5fdbe652476bbf7446183f0d787b') is None

def test_get_by_token_expired(dbsession, testdata):  # pylint: disable=unused-argument,redefined-outer-name
    """
    Expired tokens shouldn't be returned by get_by_token.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    :param list(str) testdata: pytest fixture listing test data tokens.
    """
    exp_dt = datetime.datetime.utcnow().replace(microsecond=0) - datetime.timedelta(days=3,
                                                                                    seconds=1)

# Path: models/forgot_password_tokens.py
# class ForgotPasswordTokens(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_forgot_password_tokens.py
    from builtins import *  # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import
from sqlalchemy.exc import IntegrityError
from models import forgot_password_tokens as fpt
from models import logins, profiles
    import sys
import datetime
import re
import warnings
import pytest


    dbsession.commit()
    assert token.login == login

def test_get_by_token_blank(dbsession, testdata):  # pylint: disable=unused-argument,redefined-outer-name
    """
    Blanks shouldn't be found
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    :param list(str) testdata: pytest fixture listing test data tokens.
    """
    # Include testdata so we know there are at least some records in table to search
    assert fpt.ForgotPasswordTokens.get_by_token('') is None

def test_get_by_token_unknown(dbsession, testdata):  # pylint: disable=unused-argument,redefined-outer-name
    """
    Non-existing tokens shouldn't be found
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    :param list(str) testdata: pytest fixture listing test data tokens.
    """
    assert '159a5fdbe652476bbf7446183f0d787b' not in testdata
    assert fpt.ForgotPasswordTokens.get_by_token('159a5fdbe652476bbf7446183f0d787b') is None

def test_get_by_token_expired(dbsession, testdata):  # pylint: disable=unused-argument,redefined-outer-name
    """
    Expired tokens shouldn't be returned by get_by_token.
    :param sqlalchemy.orm.session.Session dbsession: pytest fixture for database session
    :param list(str) testdata: pytest fixture listing test data tokens.
    """
    exp_dt = datetime.datetime.utcnow().replace(microsecond=0) - datetime.timedelta(days=3,
                                                                                    seconds=1)

    token = fpt.ForgotPasswordTokens.get_by_token(testdata[2])