[Erp5-report] r19352 - /erp5/trunk/products/ERP5/tests/testCRM.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Mon Feb 18 14:58:53 CET 2008
Author: jerome
Date: Mon Feb 18 14:58:53 2008
New Revision: 19352
URL: http://svn.erp5.org?rev=19352&view=rev
Log:
test event creation from event and ticket
Modified:
erp5/trunk/products/ERP5/tests/testCRM.py
Modified: erp5/trunk/products/ERP5/tests/testCRM.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testCRM.py?rev=19352&r1=19351&r2=19352&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testCRM.py (original)
+++ erp5/trunk/products/ERP5/tests/testCRM.py Mon Feb 18 14:58:53 2008
@@ -44,8 +44,8 @@
def getBusinessTemplateList(self):
return ('erp5_base', 'erp5_crm',)
- def test_CreateRelatedEvent(self):
- # test action to create a related event
+ def test_Event_CreateRelatedEvent(self):
+ # test action to create a related event from an event
for ptype in self.portal.getPortalEventTypeList():
event = self.portal.event_module.newContent(
portal_type=ptype)
@@ -59,7 +59,7 @@
new_event = self.portal.event_module._getOb(new_id)
self.assertEquals(event, new_event.getCausalityValue())
- def test_CreateRelatedEventUnauthorized(self):
+ def test_Event_CreateRelatedEventUnauthorized(self):
# test that we don't get Unauthorized error when invoking the "Create
# Related Event" without add permission on the module
event = self.portal.event_module.newContent(portal_type='Letter')
@@ -69,7 +69,44 @@
title='New Title',
description='New Desc')
-
+ def test_Ticket_CreateRelatedEvent(self):
+ # test action to create a related event from a ticket
+ ticket = self.portal.meeting_module.newContent(portal_type='Meeting')
+ for ptype in self.portal.getPortalEventTypeList():
+ # incoming
+ redirect = ticket.Ticket_newEvent(direction='incoming',
+ portal_type=ptype,
+ title='New Title',
+ description='New Desc')
+ self.assert_(redirect.startswith('http://nohost/erp5/event_module/'))
+ new_id = redirect[
+ len('http://nohost/erp5/event_module/'):].split('/', 1)[0]
+ new_event = self.portal.event_module._getOb(new_id)
+ self.assertEquals(ticket, new_event.getFollowUpValue())
+ self.assertEquals('new', new_event.getSimulationState())
+
+ # outgoing
+ redirect = ticket.Ticket_newEvent(direction='outgoing',
+ portal_type=ptype,
+ title='New Title',
+ description='New Desc')
+ self.assert_(redirect.startswith('http://nohost/erp5/event_module/'))
+ new_id = redirect[
+ len('http://nohost/erp5/event_module/'):].split('/', 1)[0]
+ new_event = self.portal.event_module._getOb(new_id)
+ self.assertEquals(ticket, new_event.getFollowUpValue())
+ self.assertEquals('planned', new_event.getSimulationState())
+
+ def test_Ticket_CreateRelatedEventUnauthorized(self):
+ # test that we don't get Unauthorized error when invoking the "Create
+ # New Event" without add permission on the module
+ ticket = self.portal.meeting_module.newContent(portal_type='Meeting')
+ self.portal.event_module.manage_permission('Add portal content', [], 0)
+ ticket.Ticket_newEvent(portal_type='Letter',
+ title='New Title',
+ description='New Desc',
+ direction='incoming')
+
class TestCRMMailIngestion(ERP5TypeTestCase):
"""Test Mail Ingestion for CRM.
More information about the Erp5-report
mailing list