class ContentTreeLayer(PloneSandboxLayer): defaultBases = (PLONE_FIXTURE, ) def setUpZope(self, app, configurationContext): import plone.formwidget.contenttree xmlconfig.file('testing.zcml', plone.formwidget.contenttree, context=configurationContext) def setUpPloneSite(self, portal): helpers.applyProfile(portal, 'plone.formwidget.contenttree:default') portal.acl_users.userFolderAddUser('admin', 'secret', ['Manager'], []) login(portal, 'admin') portal.portal_workflow.setDefaultChain("simple_publication_workflow") setRoles(portal, TEST_USER_ID, ['Manager']) CONTENTTREE_FIXTURE = ContentTreeLayer() CONTENTTREE_INTEGRATION_TESTING = layers.IntegrationTesting( bases=(CONTENTTREE_FIXTURE, ), name="plone.formwidget.contenttree:Integration") CONTENTTREE_FUNCTIONAL_TESTING = layers.FunctionalTesting( bases=(CONTENTTREE_FIXTURE, z2.ZSERVER_FIXTURE), name="plone.formwidget.contenttree:Functional") optionflags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)
PLONE_APP_LINKINTEGRITY_FIXTURE, ) def setUp(self): self.setUpContent() def setUpContent(self): super(LinkIntegrityDXLayer, self).setUpContent() with ploneSite() as portal: # Create an object that does not provide the behavior to live along create(portal, 'News Item', id='news1', title='News 1') PLONE_APP_LINKINTEGRITY_DX_FIXTURE = LinkIntegrityDXLayer() PLONE_APP_LINKINTEGRITY_AT_INTEGRATION_TESTING = layers.IntegrationTesting( bases=(PLONE_APP_LINKINTEGRITY_AT_FIXTURE, ), name='plone.app.linkintegrity:AT:Integration') PLONE_APP_LINKINTEGRITY_DX_INTEGRATION_TESTING = layers.IntegrationTesting( bases=(PLONE_APP_LINKINTEGRITY_DX_FIXTURE, ), name='plone.app.linkintegrity:DX:Integration') PLONE_APP_LINKINTEGRITY_AT_FUNCTIONAL_TESTING = layers.FunctionalTesting( bases=(PLONE_APP_LINKINTEGRITY_AT_FIXTURE, ), name='plone.app.linkintegrity:AT:Functional') PLONE_APP_LINKINTEGRITY_DX_FUNCTIONAL_TESTING = layers.FunctionalTesting( bases=(PLONE_APP_LINKINTEGRITY_DX_FIXTURE, ), name='plone.app.linkintegrity:DX:Functional')
# install into the Plone site self.applyProfile(portal, 'plone.app.referenceablebehavior:default') self.applyProfile( portal, 'plone.app.referenceablebehavior:Testing_sampletypes') ttool = getToolByName(portal, 'portal_types') ttool.getTypeInfo('Document').behaviors += ( 'plone.app.referenceablebehavior.referenceable.IReferenceable', ) setRoles(portal, TEST_USER_ID, ['Manager']) portal.invokeFactory('Document', 'doc1') portal.invokeFactory('Document', 'doc2') portal.invokeFactory('Document', 'doc3') PLONE_APP_REFERENCEABLE_FIXTURE = ReferenceableBehaviorLayer() PLONE_APP_REFERENCEABLE_INTEGRATION_TESTING = layers.IntegrationTesting( bases=(PLONE_APP_REFERENCEABLE_FIXTURE, ), name="plone.app.referenceable:Integration") PLONE_APP_REFERENCEABLE_FUNCTION_TESTING = layers.FunctionalTesting( bases=(PLONE_APP_REFERENCEABLE_FIXTURE, ), name="plone.app.referenceable:Functional") class ATRefnode(BaseContent): """A simple archetype for testing references. It can point to itself""" schema = BaseSchema.copy() + Schema(( ReferenceField('relatedItems', relationship='relatesTo', multiValued=True, isMetadata=True, languageIndependent=False,