Example #1
0
    def setUpZope(self, app, configurationContext):
        super(ContentFixtureLayer, self).setUpZope(app, configurationContext)

        # Setting up the database, which creates a new engine, must happen after
        # opengever's ZCML is loaded in order to have engine creation event
        # handlers already registered, which enable support for rolling back
        # to savepoints.
        sqlite_testing.setup_memory_database()
        if 'sqlite' in datamanager.NO_SAVEPOINT_SUPPORT:
            datamanager.NO_SAVEPOINT_SUPPORT.remove('sqlite')

        # register bumblebee task queue
        self.bumblebee_queue = BumblebeeTestTaskQueue()
        sm = getSiteManager()
        sm.registerUtility(self.bumblebee_queue,
                           provided=ITaskQueue,
                           name='test-queue')

        # provide bumblebee config by default and only deactivate bumblebee
        # with the feature flag.
        os.environ.pop('BUMBLEBEE_DEACTIVATE', None)
        os.environ['BUMBLEBEE_APP_ID'] = 'local'
        os.environ['BUMBLEBEE_SECRET'] = 'secret'
        os.environ['BUMBLEBEE_INTERNAL_PLONE_URL'] = 'http://nohost/plone'
        os.environ['BUMBLEBEE_PUBLIC_URL'] = 'http://bumblebee'

        # Set up ftw.contentstats logging for testing
        self.setup_eventlog()
        setup_logger()
Example #2
0
    def setUpZope(self, app, configurationContext):
        super(BumblebeeLayer, self).setUpZope(app, configurationContext)

        self.queue = BumblebeeTestTaskQueue()
        sm = getSiteManager()
        sm.registerUtility(self.queue, provided=ITaskQueue, name='test-queue')