def afterSetUp(self): common.installWithinPortal(self, self.portal) self.objs = common.createObjects(self, self.TYPES) self.brains = [ brain.makeBrainAggregate(self.portal, obj.UID()) for obj in self.objs ] self.ruleset = common.createRuleset(self, 'AnotherRuleset') self.ruleset.invokeFactory('Interface Constraint', 'ic') self.ic = getattr(self.ruleset, 'ic')
def afterSetUp(self): common.installWithinPortal(self, self.portal) # create some objects objs = common.createObjects(self, self.TYPES) self.brains = [ brain.makeBrainAggregate(self.portal, obj.UID()) for obj in objs ] # construct and register a ruleset self.ruleset = common.createRuleset(self, 'ruleset')
def afterSetUp(self): common.installWithinPortal(self, self.portal) self.objs = common.createObjects(self, self.TYPES) self.brains = [ brain.makeBrainAggregate(self.portal, obj.UID()) for obj in self.objs ] self.ruleset = common.createRuleset(self, 'AThirdRuleset') self.ruleset.invokeFactory('Cardinality Constraint', 'cc') self.cc = getattr(self.ruleset, 'cc')
def afterSetUp(self): common.installWithinPortal(self, self.portal) self.objs = common.createObjects(self, self.TYPES) self.brains = [ brain.makeBrainAggregate(self.portal, obj.UID()) for obj in self.objs ] self.ruleset = common.createRuleset(self, 'ARuleset') self.ruleset.invokeFactory('Inverse Implicator', 'ii') self.ii = getattr(self.ruleset, 'ii') self.ruleset2 = common.createRuleset(self, 'AnotherRuleset') self.ruleset2.invokeFactory('Inverse Implicator', 'ii') self.ii2 = getattr(self.ruleset2, 'ii')
def afterSetUp(self): common.installWithinPortal(self, self.portal) # create some objects self.objs = common.createObjects(self, self.TYPES) self.brains = [brain.makeBrainAggregate(self.portal, obj.UID()) for obj in self.objs] # construct and register a ruleset self.ruleset = common.createRuleset(self, 'ruleset') # Allow self.TYPES as target self.ruleset.invokeFactory('Type Constraint', 'tc') self.ruleset.tc.setAllowedTargetTypes(self.TYPES)
def afterSetUp(self): common.installWithinPortal(self, self.portal) self.objs = common.createObjects(self, self.TYPES) self.brains = [ brain.makeBrainAggregate(self.portal, obj.UID()) for obj in self.objs ] for name in ('ruleset1', 'ruleset2'): ruleset = common.createRuleset(self, name) setattr(self, name, ruleset) ruleset.invokeFactory('Inverse Implicator', 'ii') ruleset.invokeFactory('Content Reference', 'cr') for ruleset in self.ruleset1, self.ruleset2: ruleset.ii.setInverseRuleset( ruleset is self.ruleset1 and self.ruleset2 or self.ruleset1) ruleset.cr.setPortalType(self.TYPES[0])
def afterSetUp(self): common.installWithinPortal(self.portal) self.atvm = common.getATVM(self.portal)
import os, sys if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) from App.Common import package_home from Products.PloneTestCase import PloneTestCase from Products.Relations import config import common common.installWithinPortal() class TestXMLImportExport(PloneTestCase.PloneTestCase): def testXMLImport(self): self.loginAsPortalOwner() xmlpath=os.path.join( package_home(config.GLOBALS), 'tests', 'relations_sample.xml') f=open(xmlpath) xml=f.read() f.close() tool=self.portal.relations_library tool.importXML(xml) ruleset=tool.getRuleset('document_files') #export it xml=tool.exportXML() #now reimport the junk again tool.manage_delObjects(tool.objectIds())
def afterSetUp(self): common.installWithinPortal(self, self.portal) self.folder.invokeFactory('SimpleType', 'alfred') self.folder.invokeFactory('ComplexType', 'manfred') self.ruleset = common.createRuleset(self, 'IsParentOf')
def afterSetUp(self): common.installWithinPortal(self, self.portal)
import os, sys if __name__ == '__main__': execfile(os.path.join(sys.path[0], 'framework.py')) from Products.PloneTestCase import PloneTestCase import common common.installWithinPortal() from Products.Relations import brain from Products.Relations import utils class TestAdddeleteVocab(PloneTestCase.PloneTestCase): TYPES = 'SimpleFolder', 'SimpleType', 'ComplexType' def afterSetUp(self): # create some objects self.objs = common.createObjects(self, self.TYPES) self.brains = [ brain.makeBrainAggregate(self.portal, obj.UID()) for obj in self.objs ] # construct and register a ruleset self.ruleset = common.createRuleset(self, 'ruleset') # Allow self.TYPES as target self.ruleset.invokeFactory('Type Constraint', 'tc') self.ruleset.tc.setAllowedTargetTypes(self.TYPES)
def afterSetUp(self): common.installWithinPortal(self, self.portal) self.objs = common.createObjects(self, self.TYPES) self.rulesets = [common.createRuleset(self, j) for j in self.RULESETS]
def afterSetUp(self): common.installWithinPortal(self, self.portal) self.library = getToolByName(self.portal, RELATIONS_LIBRARY)
def afterSetUp(self): common.installWithinPortal(self, self.portal) self.objects = common.createObjects(self, self.TYPES)
def afterSetUp(self): """installs dependencies and defines atvm """ common.installWithinPortal(self.portal) self.atvm = common.getATVM(self.portal) self.loginAsPortalOwner()
def afterSetUp(self): common.installWithinPortal(self.portal) self.atvm = common.getATVM(self.portal)