def __init__(self): # Keep track of temporary files we create self.tempdir = None # By super-super-calling the __init__ we remove the SQL bases, # since we are implementing SQL setup in this layer directly. PloneSandboxLayer.__init__(self)
def tearDown(self): """ Second magical thing to remember in this layer: Be sure not to have any transaction ongoing Unless that you ll have:: ZODB.POSException.StorageTransactionError: Duplicate tpc_begin calls for same transaction """ cleanUpDispatcher(_dispatcher_uuid) gsm = component.getGlobalSiteManager() gsm.unregisterHandler(agent_installer, [IDispatcherActivated]) gsm.unregisterHandler(notifyQueueReady, [IDispatcherActivated]) gsm.unregisterHandler(configureQueue, [IQueueReady]) db = gsm.getUtility(IAsyncDatabase) gsm.unregisterUtility(db, IAsyncDatabase) transaction.commit() PloneSandboxLayer.tearDown(self)
def __init__(self): # By super-super-calling the __init__ we remove the SQL bases, # since we are implementing SQL setup in this layer directly. PloneSandboxLayer.__init__(self)
class PloneAppQuerystringLayer(PloneAppQuerystringTestProfileLayer): def setUpZope(self, app, configurationContext): super(PloneAppQuerystringLayer, self).setUpZope(app, configurationContext) z2.installProduct(app, 'plone.app.querystring') import plone.app.querystring xmlconfig.file('configure.zcml', plone.app.querystring, context=configurationContext) def setUpPloneSite(self, portal): super(PloneAppQuerystringLayer, self).setUpPloneSite(portal) applyProfile(portal, 'plone.app.querystring:default') PLONEAPPQUERYSTRING_FIXTURE = PloneAppQuerystringLayer() PLONEAPPQUERYSTRING_INTEGRATION_TESTING = IntegrationTesting( bases=(PLONEAPPQUERYSTRING_FIXTURE, ), name="PloneAppQuerystringLayer:Integration") TEST_PROFILE_PLONEAPPQUERYSTRING_INTEGRATION_TESTING = IntegrationTesting( bases=(TEST_PROFILE_PLONEAPPQUERYSTRING_FIXTURE, ), name="PloneAppQuerystringTestProfileLayer:Integration") NOT_INSTALLED_PLONEAPPQUERYSTRING_INTEGRATION_TESTING = IntegrationTesting( bases=(PloneSandboxLayer(), ), name="UninstalledPloneAppQuerystringLayer:Integration")
from plone.app.testing import PloneSandboxLayer from plone.app.testing import FunctionalTesting CONTENTTYPEVALIDATOR = PloneSandboxLayer(name='CONTENTTYPEVALIDATOR') CONTENTTYPEVALIDATOR_FUNCTIONAL = FunctionalTesting( bases=(CONTENTTYPEVALIDATOR, ), name='CONTENTTYPEVALIDATOR_FUNCTIONAL')
def setUp(self): # Make sure we're testing in a predictable timezone os.environ['TZ'] = 'UTC' PloneSandboxLayer.setUp(self)
from plone.app.testing import PloneSandboxLayer from plone.app.testing.layers import FunctionalTesting PLONEAPPJQUERYTPOOLS_FUNCTIONAL_TESTING = FunctionalTesting( bases=(PloneSandboxLayer(), ), name="PloneAppJquerytools:Functional")