Commit df818e00 authored by Aurel's avatar Aurel

add a test to prooves that cloning an event does not work as exepected

when event comes from ingestion


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39131 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 341376df
...@@ -498,6 +498,40 @@ class TestCRMMailIngestion(BaseTestCRM): ...@@ -498,6 +498,40 @@ class TestCRMMailIngestion(BaseTestCRM):
self.assertEquals(['person_module/he', 'person_module/me'], self.assertEquals(['person_module/he', 'person_module/me'],
destination_list) destination_list)
def test_clone(self):
# cloning an event must keep title and text-content
event = self._ingestMail('simple')
transaction.commit()
self.tic()
self.assertEquals('Simple Mail Test', event.getTitle())
self.assertEquals('Simple Mail Test', event.getTitleOrId())
self.assertEquals('Hello,\nContent of the mail.\n', str(event.asText()))
self.assertEquals('Hello,\nContent of the mail.\n', str(event.getTextContent()))
self.assertEquals('Mail Message', event.getPortalType())
self.assertEquals('text/plain', event.getContentType())
self.assertEquals('message/rfc822', event._baseGetContentType())
# check if parsing of metadata from content is working
content_dict = {'source_list': ['person_module/sender'],
'destination_list': ['person_module/me',
'person_module/he']}
self.assertEquals(event.getPropertyDictFromContent(), content_dict)
new_event = event.Base_createCloneDocument(batch_mode=1)
transaction.commit()
self.tic()
self.assertEquals('Simple Mail Test', new_event.getTitle())
self.assertEquals('Simple Mail Test', new_event.getTitleOrId())
self.assertEquals('Hello,\nContent of the mail.\n', str(new_event.asText()))
self.assertEquals('Hello,\nContent of the mail.\n', str(new_event.getTextContent()))
self.assertEquals('Mail Message', new_event.getPortalType())
self.assertEquals('text/plain', new_event.getContentType())
self.assertEquals('message/rfc822', new_event._baseGetContentType())
# check if parsing of metadata from content is working
content_dict = {'source_list': ['person_module/sender'],
'destination_list': ['person_module/me',
'person_module/he']}
self.assertEquals(new_event.getPropertyDictFromContent(), content_dict)
def test_follow_up(self): def test_follow_up(self):
# follow up is found automatically, based on the content of the mail, and # follow up is found automatically, based on the content of the mail, and
# what you defined in preference regexpr. # what you defined in preference regexpr.
......
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