def setUp(self):
        from sqlalchemy import create_engine

        conf = load_config().get("functional", dict())
        self.dbsession = sqla_orm.scoped_session(sqla_orm.sessionmaker(extension=ZopeTransactionExtension(), expire_on_commit=False))

        dbengine = create_engine(conf.get(u"sqlite_conn_str"))
        initialize_sql(dbengine, self.dbsession)

        credentials = se.Credentials(conf.get("storage_dir"), self.dbsession)
        self.engine = se.DefaultStorageEngine(credentials)
    def setUp(self):
        from sqlalchemy import create_engine

        conf = load_config().get("functional", dict())
        self.dbsession = sqla_orm.scoped_session(
            sqla_orm.sessionmaker(extension=ZopeTransactionExtension(),
                                  expire_on_commit=False))

        dbengine = create_engine(conf.get(u"sqlite_conn_str"))
        initialize_sql(dbengine, self.dbsession)

        credentials = se.Credentials(conf.get("storage_dir"), self.dbsession)
        self.engine = se.DefaultStorageEngine(credentials)
示例#3
0
    def setUp(self):
        super(AbstractImageTest, self).setUp()
        from sqlalchemy import create_engine
        import sqlalchemy.orm as sqla_orm
        from zope.sqlalchemy import ZopeTransactionExtension
        
        unittest.TestCase.setUp(self)
        
        self.conf = load_config().get("integration", dict())
        
        self.dbsession = sqla_orm.scoped_session(sqla_orm.sessionmaker(extension=ZopeTransactionExtension(), expire_on_commit=False))

        dbengine = create_engine(self.conf.get(u"sqlite_conn_str"))
        initialize_sql(dbengine, self.dbsession)