# Path: tests/functional/testcases.py
# class APITestCase(TestCaseMixin, TransactionTestCase):
# 
#     def login(self):
#         self.client.login(username=self.username, password=self.password)
# 
# 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'])


import json
from .testcases import APITestCase
from ..factories import DbFactory
from django.core.urlresolvers import reverse



class QueryInteractiveAPITest(APITestCase):

    def setUp(self):
        self.user = self.create_user(is_staff=True)
        self.login()

# Path: tests/functional/testcases.py
# class APITestCase(TestCaseMixin, TransactionTestCase):
# 
#     def login(self):
#         self.client.login(username=self.username, password=self.password)
# 
# 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/test_query_interactive.py
import json
from .testcases import APITestCase
from ..factories import DbFactory
from django.core.urlresolvers import reverse




class QueryInteractiveAPITest(APITestCase):

    def setUp(self):
        self.user = self.create_user(is_staff=True)
        self.login()

        self.db = DbFactory()