# Path: tests/factories.py
# class DbFactory(TagsFactory):
#     class Meta:
#         model = website.models.Db
#         exclude = ('DB',)
# 
#     DB = settings.DATABASES['default']
#     name_short = "default"
#     name_long = "default"
#     type = "MySQL"
#     host = factory.LazyAttribute(lambda a: a.DB['HOST'])
#     db = factory.LazyAttribute(lambda a: a.DB['NAME'])
#     port = factory.LazyAttribute(lambda a: a.DB['PORT'] or "3306")
#     username = factory.LazyAttribute(lambda a: a.DB['USER'])
#     password_encrypted = factory.LazyAttribute(lambda a: a.DB['PASSWORD'])
# 
# Path: tests/functional/testcases.py
# class LiveServerTestCase(TestCaseMixin, BaseLiveServerTestCase):
# 
#     """Base test case for in-browser functional tests."""
# 
#     initial_url = None
#     login_button_value = 'Log in'
# 
#     def login(self):
#         self.browser.fill('username', self.username)
#         self.browser.fill('password', self.password)
#         self.browser.find_by_value(self.login_button_value).click()
# 
#     def create_staff_user(self, **kwargs):
#         kwargs.setdefault('is_staff', True)
#         kwargs.setdefault('is_superuser', True)
#         return super(LiveServerTestCase, self).create_user(**kwargs)
# 
#     def setUp(self):
#         self.browser = Browser('django')
#         if self.initial_url is not None:
#             self.browser.visit("{}{}".format(
#                 self.live_server_url,
#                 self.initial_url,
#             ))
# 
#     def tearDown(self):
#         self.browser.quit()


from ..factories import DbFactory
from .testcases import LiveServerTestCase


class AdminQueryPageTest(LiveServerTestCase):

    initial_url = "/admin/"

    def setUp(self):
        super(AdminQueryPageTest, self).setUp()
        self.user = self.create_user()
        self.login()

    def create_user(self, **kwargs):

# Path: tests/factories.py
# class DbFactory(TagsFactory):
#     class Meta:
#         model = website.models.Db
#         exclude = ('DB',)
# 
#     DB = settings.DATABASES['default']
#     name_short = "default"
#     name_long = "default"
#     type = "MySQL"
#     host = factory.LazyAttribute(lambda a: a.DB['HOST'])
#     db = factory.LazyAttribute(lambda a: a.DB['NAME'])
#     port = factory.LazyAttribute(lambda a: a.DB['PORT'] or "3306")
#     username = factory.LazyAttribute(lambda a: a.DB['USER'])
#     password_encrypted = factory.LazyAttribute(lambda a: a.DB['PASSWORD'])
# 
# Path: tests/functional/testcases.py
# class LiveServerTestCase(TestCaseMixin, BaseLiveServerTestCase):
# 
#     """Base test case for in-browser functional tests."""
# 
#     initial_url = None
#     login_button_value = 'Log in'
# 
#     def login(self):
#         self.browser.fill('username', self.username)
#         self.browser.fill('password', self.password)
#         self.browser.find_by_value(self.login_button_value).click()
# 
#     def create_staff_user(self, **kwargs):
#         kwargs.setdefault('is_staff', True)
#         kwargs.setdefault('is_superuser', True)
#         return super(LiveServerTestCase, self).create_user(**kwargs)
# 
#     def setUp(self):
#         self.browser = Browser('django')
#         if self.initial_url is not None:
#             self.browser.visit("{}{}".format(
#                 self.live_server_url,
#                 self.initial_url,
#             ))
# 
#     def tearDown(self):
#         self.browser.quit()


# Path: tests/functional/test_admin.py
from ..factories import DbFactory
from .testcases import LiveServerTestCase



class AdminQueryPageTest(LiveServerTestCase):

    initial_url = "/admin/"

    def setUp(self):
        super(AdminQueryPageTest, self).setUp()
        self.user = self.create_user()
        self.login()

    def create_user(self, **kwargs):

        return super(LiveServerTestCase, self).create_user(