# Path: webtools/database.py

# 
# Path: webtools/auth/models.py
# class User(Base):
#     __tablename__ = 'users'
# 
#     id = Column(Integer, primary_key=True, autoincrement=True)
#     username = Column(Unicode(200), nullable=False, index=True)
#     first_name = Column(Unicode(200), nullable=False)
#     last_name = Column(Unicode(200), nullable=False)
#     email = Column(Unicode(200), nullable=False)
#     password = Column(String(200), nullable=False)
# 
#     def __repr__(self):
#         return "<User {0}>".format(self.id)
# 
#     def set_password(self, password):
#         self.password = make_password(password)
# 
#     def check_password(self, password):
#         return check_password(password, self.password)
# 
# Path: tests/settings.py
# class TestOverwriteSettings(Settings):
#     SQLALCHEMY_ENGINE_URL = "sqlite://"
#     AUTHENTICATION_BACKENDS = ["webtools.auth.backends.DatabaseAuthenticationBackend"]
# 
#     JINJA2_TEMPLATE_DIRS = [
#         os.path.join(CURRENT_PATH, "template")
#     ]
#     INSTALLED_MODULES = [
#         "tests",
#     ]
# 
#     COMMANDS = [
#         "webtools.management.commands.runserver.RunserverCommand",
#     ]
# 
#     I18N = True
# 
#     I18N_DIRECTORIES = [
#         os.path.join(CURRENT_PATH, "locale"),
#     ]


import unittest
from webtools.database import Base
from webtools.auth.models import User
from .settings import TestOverwriteSettings
        from webtools.application import Application



class AuthDatabaseTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):

        cls.app = Application(TestOverwriteSettings())
        Base.metadata.create_all(cls.app.engine)

    @classmethod
    def tearDownClass(cls):

# Path: webtools/database.py

# 
# Path: webtools/auth/models.py
# class User(Base):
#     __tablename__ = 'users'
# 
#     id = Column(Integer, primary_key=True, autoincrement=True)
#     username = Column(Unicode(200), nullable=False, index=True)
#     first_name = Column(Unicode(200), nullable=False)
#     last_name = Column(Unicode(200), nullable=False)
#     email = Column(Unicode(200), nullable=False)
#     password = Column(String(200), nullable=False)
# 
#     def __repr__(self):
#         return "<User {0}>".format(self.id)
# 
#     def set_password(self, password):
#         self.password = make_password(password)
# 
#     def check_password(self, password):
#         return check_password(password, self.password)
# 
# Path: tests/settings.py
# class TestOverwriteSettings(Settings):
#     SQLALCHEMY_ENGINE_URL = "sqlite://"
#     AUTHENTICATION_BACKENDS = ["webtools.auth.backends.DatabaseAuthenticationBackend"]
# 
#     JINJA2_TEMPLATE_DIRS = [
#         os.path.join(CURRENT_PATH, "template")
#     ]
#     INSTALLED_MODULES = [
#         "tests",
#     ]
# 
#     COMMANDS = [
#         "webtools.management.commands.runserver.RunserverCommand",
#     ]
# 
#     I18N = True
# 
#     I18N_DIRECTORIES = [
#         os.path.join(CURRENT_PATH, "locale"),
#     ]


# Path: tests/test_auth.py
import unittest
from webtools.database import Base
from webtools.auth.models import User
from .settings import TestOverwriteSettings
        from webtools.application import Application




class AuthDatabaseTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):

        cls.app = Application(TestOverwriteSettings())
        Base.metadata.create_all(cls.app.engine)

    @classmethod
    def tearDownClass(cls):

        Base.metadata.drop_all(cls.app.engine)