Commit 3b279f88 authored by Jérome Perrin's avatar Jérome Perrin

test sale opportunity workflow


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19434 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dab3de70
...@@ -114,6 +114,50 @@ class TestCRM(ERP5TypeTestCase): ...@@ -114,6 +114,50 @@ class TestCRM(ERP5TypeTestCase):
# XXX this fail when no persons are selected in listbox # XXX this fail when no persons are selected in listbox
raise NotImplementedError raise NotImplementedError
def test_SaleOpportunitySold(self):
# test the workflow of sale opportunities, when the sale opportunity is
# finaly sold
so = self.portal.sale_opportunity_module.newContent(
portal_type='Sale Opportunity')
self.assertEquals('draft', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'submit_action')
self.assertEquals('submitted', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'validate_action')
self.assertEquals('contacted', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'enquire_action')
self.assertEquals('enquired', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'offer_action')
self.assertEquals('offered', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'sell_action')
self.assertEquals('sold', so.getSimulationState())
def test_SaleOpportunityRejected(self):
# test the workflow of sale opportunities, when the sale opportunity is
# finaly rejected.
# Uses different transitions than test_SaleOpportunitySold
so = self.portal.sale_opportunity_module.newContent(
portal_type='Sale Opportunity')
self.assertEquals('draft', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'validate_action')
self.assertEquals('contacted', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'enquire_action')
self.assertEquals('enquired', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'offer_action')
self.assertEquals('offered', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'reject_action')
self.assertEquals('rejected', so.getSimulationState())
def test_SaleOpportunityExpired(self):
# test the workflow of sale opportunities, when the sale opportunity
# expires
so = self.portal.sale_opportunity_module.newContent(
portal_type='Sale Opportunity')
self.assertEquals('draft', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'validate_action')
self.assertEquals('contacted', so.getSimulationState())
self.portal.portal_workflow.doActionFor(so, 'expire_action')
self.assertEquals('expired', so.getSimulationState())
class TestCRMMailIngestion(ERP5TypeTestCase): class TestCRMMailIngestion(ERP5TypeTestCase):
"""Test Mail Ingestion for CRM. """Test Mail Ingestion for CRM.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment