def setUp(self): super(SearchTests, self).setUp() self.root = placefulSetUp(True) setUpZCML(self) import quotationtool.search XMLConfig('configure.zcml', quotationtool.search)() hooks.setSite(self.root) # we need a transaction from zope.security.management import newInteraction interaction = newInteraction() testing.generateCategorizableItemDescriptions(self.root) testing.generateCategoriesContainer(self.root) testing.setUpIntIds(self) testing.setUpIndices(self) testing.setUpRelationCatalog(self) self.root['item1'] = item1 = testing.Categorizable() self.root['item2'] = item2 = testing.Categorizable() from zope.intid.interfaces import IIntIds self.intids = zope.component.getUtility(IIntIds, context=self.root) self.intids.register(self.root['item1']) self.intids.register(self.root['item2']) attribution1 = interfaces.IAttribution(item1) attribution1.set(('cat11', 'cat21', 'cat31',)) attribution2 = interfaces.IAttribution(item2) attribution2.set(('cat12', 'cat22', 'cat32',)) from quotationtool.search.searcher import QuotationtoolSearchFilter zope.interface.classImplements( QuotationtoolSearchFilter, interfaces.IAttributionSearchFilter)
def setUp(self): super(AttributionTests, self).setUp() self.root = placefulSetUp(True) setUpZCML(self) hooks.setSite(self.root) # we need a transaction from zope.security.management import newInteraction interaction = newInteraction() testing.generateCategorizableItemDescriptions(self.root) testing.generateCategoriesContainer(self.root) testing.setUpIntIds(self) testing.setUpIndices(self) testing.setUpRelationCatalog(self) from quotationtool.workflow import testing as workflowtesting workflowtesting.setUpWorkLists(self.root) workflowtesting.setUpIndices(self) from quotationtool.workflow.interfaces import IWorkList self.editor_items = zope.component.getUtility(IWorkList, name='editor', context=self.root) self.contributor_items = zope.component.getUtility(IWorkList, name='contributor', context=self.root) # create item and its intid from quotationtool.workflow.interfaces import IHasWorkflowHistory zope.interface.classImplements(testing.Categorizable, IHasWorkflowHistory) self.root['item'] = item = testing.Categorizable() from zope.intid.interfaces import IIntIds self.intids = zope.component.getUtility(IIntIds, context=self.root) self.intids.register(self.root['item'])
def setUpRelatedAttribution(test): placelesssetup.setUp(test) setUpZCML(test) test.globs['root'] = root = rootFolder() testing.setUpIndices(test) testing.setUpIntIds(test) interaction = newInteraction()
def setUpWorkflowConfig(test): setUpZCML(test) test.globs['root'] = root = rootFolder() testing.setUpIntIds(test) testing.setUpIndices(test) from quotationtool.workflow.testing import setUpIndices as setUpWorkflowIndices setUpWorkflowIndices(test)
def setUp(self): super(AttributionTests, self).setUp() setUpZCML(self) self.root = rootFolder() testing.setUpIntIds(self) interaction = newInteraction() # needed for generation of categories testing.generateCategorizableItemDescriptions(self.root) testing.generateCategoriesContainer(self.root) testing.setUpIndices(self) from quotationtool.categorization.interfaces import ICategoriesContainer self.categories = zope.component.getUtility(ICategoriesContainer, context=self.root)
def setUp(self): super(ReclassificationTests, self).setUp() self.root = placefulSetUp(True) setUpZCML(self) hooks.setSite(self.root) testing.setUpIntIds(self) testing.setUpIndices(self) testing.setUpRelationCatalog(self) interaction = newInteraction() # needed for generation of categories testing.generateCategorizableItemDescriptions(self.root) testing.generateCategoriesContainer(self.root) from quotationtool.workflow import testing as workflowtesting workflowtesting.setUpWorkLists(self.root) workflowtesting.setUpIndices(self) from quotationtool.workflow.interfaces import IWorkList self.editor_items = zope.component.getUtility(IWorkList, name='editor', context=self.root) self.contributor_items = zope.component.getUtility(IWorkList, name='contributor', context=self.root) self.item = self.root['item'] = testing.Categorizable() attr = interfaces.IAttribution(self.item) attr.set(('cat12', 'cat22', 'cat32'))
def setUpPlay(test): setUpZCML(test) testing.setUpIndices(test) testing.setUpIntIds(test)