Commit 856a5dfc authored by Yusei Tahara's avatar Yusei Tahara

Added a new test for acknowledge transition.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21168 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 260445e2
...@@ -51,7 +51,6 @@ class TestCRM(ERP5TypeTestCase): ...@@ -51,7 +51,6 @@ class TestCRM(ERP5TypeTestCase):
def test_Event_CreateRelatedEvent(self): def test_Event_CreateRelatedEvent(self):
# test workflow to create a related event from responded event # test workflow to create a related event from responded event
event_module = self.portal.event_module event_module = self.portal.event_module
event_module_url = event_module.absolute_url()
portal_workflow = self.portal.portal_workflow portal_workflow = self.portal.portal_workflow
for ptype in self.portal.getPortalEventTypeList(): for ptype in self.portal.getPortalEventTypeList():
event = event_module.newContent(portal_type=ptype) event = event_module.newContent(portal_type=ptype)
...@@ -244,6 +243,46 @@ class TestCRM(ERP5TypeTestCase): ...@@ -244,6 +243,46 @@ class TestCRM(ERP5TypeTestCase):
self.portal.portal_workflow.doActionFor(so, 'expire_action') self.portal.portal_workflow.doActionFor(so, 'expire_action')
self.assertEquals('expired', so.getSimulationState()) self.assertEquals('expired', so.getSimulationState())
def test_Event_AcknowledgeAndCreateEvent(self):
"""
Make sure that when acknowledge event, we can create a new event.
"""
portal_workflow = self.portal.portal_workflow
# if create_event option is false, it does not create a new event.
for portal_type in self.portal.getPortalEventTypeList():
ticket = self.portal.meeting_module.newContent(portal_type='Meeting',
title='Meeting1')
ticket_url = ticket.getRelativeUrl()
event = self.portal.event_module.newContent(portal_type=portal_type,
follow_up=ticket_url)
get_transaction().commit()
self.tic()
self.assertEqual(len(event.getCausalityRelatedValueList()), 0)
event.receive()
portal_workflow.doActionFor(event, 'acknowledge_action', create_event=0)
get_transaction().commit()
self.tic()
self.assertEqual(len(event.getCausalityRelatedValueList()), 0)
# if create_event option is true, it create a new event.
for portal_type in self.portal.getPortalEventTypeList():
ticket = self.portal.meeting_module.newContent(portal_type='Meeting',
title='Meeting1')
ticket_url = ticket.getRelativeUrl()
event = self.portal.event_module.newContent(portal_type=portal_type,
follow_up=ticket_url)
get_transaction().commit()
self.tic()
self.assertEqual(len(event.getCausalityRelatedValueList()), 0)
event.receive()
portal_workflow.doActionFor(event, 'acknowledge_action', create_event=1)
get_transaction().commit()
self.tic()
self.assertEqual(len(event.getCausalityRelatedValueList()), 1)
new_event = event.getCausalityRelatedValue()
self.assertEqual(new_event.getFollowUp(), ticket_url)
class TestCRMMailIngestion(ERP5TypeTestCase): class TestCRMMailIngestion(ERP5TypeTestCase):
"""Test Mail Ingestion for standalone CRM. """Test Mail Ingestion for standalone 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