Menu

← Back to all posts

Tech

Load overrides.zcml in plone.app.testing

Today I was working on a project where we use overrides.zcml to easily override some default Plone behavior. All was working fine (in the browser, that is)...

Neyts ZupanNeyts Zupan
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import PloneSandboxLayer
from plone.testing import z2
from zope.configuration import xmlconfig

class MyProductLayer(PloneSandboxLayer):

    defaultBases = (PLONE_FIXTURE,)

    def setUpZope(self, app, configurationContext):
        import my.product
        self.loadZCML(package=my.product)
        xmlconfig.includeOverrides(configurationContext, 'overrides.zcml', package=my.product)
        z2.installProduct(app, 'my.product')
Neyts Zupan

Neyts Zupan

Neyts is the Digital Overlord of Niteo, poking his nose into any and all technical things.