Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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'])
Exemplo n.º 3
0
def setUpFieldConfig(test):
    test.globs = {'root': placefulSetUp(True)}  # placeful setup
    root = test.globs['root']
    setUpZCML(test)
    hooks.setSite(root)
    interaction = newInteraction()
    testing.generateCategorizableItemDescriptions(root)
Exemplo n.º 4
0
def setUpDataManager(test):
    tearDownPlaces(test)
    test.globs = {'root': placefulSetUp(True)} # placeful setup
    root = test.globs['root']
    setUpZCML(test)
    hooks.setSite(root)
    testing.generateCategorizableItemDescriptions(root)
    from zope.security.management import newInteraction
    interaction = newInteraction()
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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'))
Exemplo n.º 7
0
 def test_generation(self):
     """ We had some problems with placeful setup so this should be
     tested."""
     testing.generateCategorizableItemDescriptions(self.root)