2014-03-20 17:45:13 +00:00
|
|
|
import logging
|
2014-02-05 09:01:06 +00:00
|
|
|
from unittest import TestCase
|
2014-05-18 07:15:37 +00:00
|
|
|
from redash import settings
|
2014-02-05 09:01:06 +00:00
|
|
|
settings.DATABASE_CONFIG = {
|
2014-02-06 18:19:01 +00:00
|
|
|
'name': 'circle_test',
|
2014-02-05 09:01:06 +00:00
|
|
|
'threadlocals': True
|
|
|
|
}
|
|
|
|
|
2014-05-18 07:15:37 +00:00
|
|
|
from redash import models
|
2014-03-20 17:45:13 +00:00
|
|
|
|
2014-05-18 07:15:37 +00:00
|
|
|
logging.getLogger('peewee').setLevel(logging.INFO)
|
2014-02-05 09:01:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
class BaseTestCase(TestCase):
|
|
|
|
def setUp(self):
|
2014-05-18 07:15:37 +00:00
|
|
|
models.create_db(True, True)
|
|
|
|
models.init_db()
|
2014-02-05 09:01:06 +00:00
|
|
|
|
|
|
|
def tearDown(self):
|
2014-05-18 07:15:37 +00:00
|
|
|
models.db.close_db(None)
|
|
|
|
models.create_db(False, True)
|