def test_from_bugtask(self):
     bugtask = self.factory.makeBug(milestone=self.milestone).bugtasks[0]
     workitem = GenericWorkItem.from_bugtask(bugtask)
     self.assertEqual(workitem.assignee, bugtask.assignee)
     self.assertEqual(workitem.status, bugtask.status)
     self.assertEqual(workitem.priority, bugtask.importance)
     self.assertEqual(workitem.target, bugtask.target)
     self.assertEqual(workitem.title, bugtask.bug.description)
     self.assertEqual(workitem.actual_workitem, bugtask)
 def test_from_bugtask(self):
     bugtask = self.factory.makeBug(milestone=self.milestone).bugtasks[0]
     workitem = GenericWorkItem.from_bugtask(bugtask)
     self.assertEqual(workitem.assignee, bugtask.assignee)
     self.assertEqual(workitem.status, bugtask.status)
     self.assertEqual(workitem.priority, bugtask.importance)
     self.assertEqual(workitem.target, bugtask.target)
     self.assertEqual(workitem.title, bugtask.bug.description)
     self.assertEqual(workitem.actual_workitem, bugtask)
 def test_from_workitem(self):
     workitem = self.factory.makeSpecificationWorkItem(
         milestone=self.milestone)
     generic_wi = GenericWorkItem.from_workitem(workitem)
     self.assertEqual(generic_wi.assignee, workitem.assignee)
     self.assertEqual(generic_wi.status, workitem.status)
     self.assertEqual(generic_wi.priority, workitem.specification.priority)
     self.assertEqual(generic_wi.target, workitem.specification.target)
     self.assertEqual(generic_wi.title, workitem.title)
     self.assertEqual(generic_wi.actual_workitem, workitem)
 def test_from_workitem(self):
     workitem = self.factory.makeSpecificationWorkItem(
         milestone=self.milestone)
     generic_wi = GenericWorkItem.from_workitem(workitem)
     self.assertEqual(generic_wi.assignee, workitem.assignee)
     self.assertEqual(generic_wi.status, workitem.status)
     self.assertEqual(generic_wi.priority, workitem.specification.priority)
     self.assertEqual(generic_wi.target, workitem.specification.target)
     self.assertEqual(generic_wi.title, workitem.title)
     self.assertEqual(generic_wi.actual_workitem, workitem)