Ejemplo n.º 1
0
import os
import sys
import transaction

loghandler = logging.StreamHandler(stream=sys.stdout)
loghandler.setLevel(logging.WARNING)
for name, level in {
        'plone.protect': logging.INFO,
        'plone.app.viewletmanager': logging.ERROR,
        'opengever.base.protect': logging.INFO
}.items():
    logger = logging.getLogger(name)
    logger.addHandler(loghandler)
    logger.setLevel(level)

snapshots.disable()
TestCase.longMessage = True


def clear_transmogrifier_registry():
    transmogrifier.configuration_registry._config_info = {}
    transmogrifier.configuration_registry._config_ids = []


def toggle_feature(registry_interface, enabled=True):

    api.portal.set_registry_record('is_feature_enabled',
                                   enabled,
                                   interface=registry_interface)
    transaction.commit()
Ejemplo n.º 2
0
import logging
import os
import sys
import transaction


loghandler = logging.StreamHandler(stream=sys.stdout)
loghandler.setLevel(logging.WARNING)
for name, level in {'plone.protect': logging.INFO,
                    'opengever.base.protect': logging.INFO}.items():
    logger = logging.getLogger(name)
    logger.addHandler(loghandler)
    logger.setLevel(level)


snapshots.disable()


def clear_transmogrifier_registry():
    transmogrifier.configuration_registry._config_info = {}
    transmogrifier.configuration_registry._config_ids = []


def setup_sql_tables():
    # Create opengever.ogds.base SQL tables
    create_sql_tables()

    # Create opengever.globalindex SQL tables
    model.Base.metadata.create_all(create_session().bind)

    # Activate savepoint "support" for sqlite