def setup_app(command, conf, vars): """Place any commands to setup sso here""" # load_environment(conf.global_conf, conf.local_conf) print "command", command print "conf", conf print "vars", vars # Create the tables if they don't already exist # meta.metadata.create_all(bind=meta.engine) engine = engine_from_config(conf, 'sqlalchemy.') initialize_sql(engine) init_data()
import logging import unittest from pyramid import testing from pyramid.config import Configurator log = logging.getLogger(__name__) __all__ = ['session', 'TestBase'] from sqlalchemy import create_engine from motionman.models import initialize_sql initialize_sql(create_engine('sqlite://')) from motionman.models.init_data import init_data init_data() class TestBase(unittest.TestCase): def setUp(self): self.config = testing.setUp() self.request = testing.DummyRequest() log.info(self._testMethodName + " start...") def tearDown(self): testing.tearDown() log.info(self._testMethodName + " end...")