redash/tests/__init__.py

21 lines
445 B
Python
Raw Normal View History

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