Пример #1
0
 def test_WorkItem(self):
     from quotationtool.categorization.browser import attribution
     classifySubscriber(self.root['item'], None)
     pagelet = attribution.EditorBranchForm(
         self.editor_items.pop(), TestRequest())
     pagelet.update()
     self.assertTrue(isinstance(pagelet.attribution.getCategorizableItem(), testing.Categorizable))
     for cat in self.root['categories'].keys():
         self.assertTrue(cat in pagelet.attribution.widgets.keys())
     self.assertTrue(isinstance(pagelet.render(), unicode))
Пример #2
0
 def test_FinishedEditorItem(self):
     from quotationtool.categorization.browser import attribution
     classifySubscriber(self.root['item'], None)
     request = TestRequest(form={
             'attribution.widgets.set1': u'cat13',
             'attribution.widgets.set2': u'cat23',
             'attribution.widgets.set3': u'cat33',
             'form.widgets.workflow-message': u'OK?',
             'form.buttons.finish': u"Finish"})
     pagelet = attribution.EditorBranchForm(
         self.editor_items.pop(), request)
     pagelet.update()
     self.assertTrue(interfaces.IAttribution(self.root['item']).isAttributed('cat13'))
     self.assertTrue(interfaces.IAttribution(self.root['item']).isAttributed('cat23'))
     self.assertTrue(interfaces.IAttribution(self.root['item']).isAttributed('cat33'))
     self.assertTrue(not interfaces.IAttribution(self.root['item']).isAttributed('cat11'))
     self.assertTrue(len(self.editor_items.values()) == 0)
Пример #3
0
 def test_EditorialReviewItem(self):
     from quotationtool.categorization.browser import attribution
     classifySubscriber(self.root['item'], None)
     cntr = self.contributor_items.pop()
     cntr.finish('finish', u"Done")
     request = TestRequest(form={
             'attribution.widgets.set1': u'cat13',
             'attribution.widgets.set2': u'cat23',
             'attribution.widgets.set3': u'cat33',
             'form.widgets.workflow-message': u'OK',
             'form.buttons.finish': u"Finish"})
     pagelet = attribution.EditorialReviewForm(
         self.editor_items.pop(), request)
     pagelet.update()
     self.assertTrue(pagelet.message() == u"OK")
     # now saved on database item
     self.assertTrue(interfaces.IAttribution(self.root['item']).isAttributed('cat13'))
     self.assertTrue(interfaces.IAttribution(self.root['item']).isAttributed('cat23'))
     self.assertTrue(interfaces.IAttribution(self.root['item']).isAttributed('cat33'))
     self.assertTrue(not interfaces.IAttribution(self.root['item']).isAttributed('cat11'))
     self.assertTrue(len(self.editor_items.values()) == 0)
Пример #4
0
 def test_IfWorkItemPresent(self):
     # create work item
     classifySubscriber(self.root['item'], None)
     self.assertTrue(len(self.editor_items.values()) == 1)