def test_app_layer_enabled_directly(self): folder = api.content.create(container=self.portal, type='Folder', title='testfolder') api.content.transition(folder, 'publish') alsoProvides(folder, IMockFolder) folder.app_layers = (IMockLayer, ) BeforeTraverse.registerBeforeTraverse(folder, enable_app_layer(), 'enable_app_layer') transaction.commit() browser = Browser(self.app) browser.open("%s/@@browser_layers" % folder.absolute_url()) self.assertTrue( 'ploneintranet.layout.tests.utils.IMockLayer' in browser.contents)
def test_app_layer_enabled_directly(self): folder = api.content.create(container=self.portal, type='Folder', title='testfolder') api.content.transition(folder, 'publish') directlyProvides(folder, IMockFolder) folder.app_layers = (IMockLayer,) BeforeTraverse.registerBeforeTraverse(folder, enable_app_layer(), 'enable_app_layer') transaction.commit() browser = Browser(self.app) browser.open("%s/@@browser_layers" % folder.absolute_url()) self.assertTrue('ploneintranet.layout.tests.utils.IMockLayer' in browser.contents)
def register_app_hook(self): """Separate method for easy re-use with mixed inheritance""" registerBeforeTraverse(self, enable_app_layer(), 'enable_app_layer')