Commit 042d90b7 authored by Nicolas Delaby's avatar Nicolas Delaby

include getPropertyDictFromContent result in properties copied on cloned

event.

and update test according behaviour of Event_afterClone
parent 95a2e278
...@@ -51,10 +51,12 @@ ...@@ -51,10 +51,12 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># We must copy these properties as they are retrieved from data\n <value> <string># We must copy these properties as they are retrieved from data\n
title = context.getTitle()\n content_dict = context.getPropertyDictFromContent()\n
content = context.getTextContent()\n content_dict[\'title\'] = context.getTitle()\n
type = context.getContentType()\n content_dict[\'text_content\'] = context.getTextContent()\n
context.edit(title=title, text_content=content, content_type=type, data=None)\n content_dict[\'content_type\'] = context.getContentType()\n
content_dict[\'data\'] = None\n
context.edit(**content_dict)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
569 570
\ No newline at end of file \ No newline at end of file
...@@ -602,12 +602,11 @@ class TestCRMMailIngestion(BaseTestCRM): ...@@ -602,12 +602,11 @@ class TestCRMMailIngestion(BaseTestCRM):
self.assertEquals('Hello,\nContent of the mail.\n', str(new_event.getTextContent())) self.assertEquals('Hello,\nContent of the mail.\n', str(new_event.getTextContent()))
self.assertEquals('Mail Message', new_event.getPortalType()) self.assertEquals('Mail Message', new_event.getPortalType())
self.assertEquals('text/plain', new_event.getContentType()) self.assertEquals('text/plain', new_event.getContentType())
# 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)
# check that metadatas read from data are copied on cloned event
self.assertEquals(new_event.getSourceList(), ['person_module/sender'])
self.assertEquals(new_event.getDestinationList(), ['person_module/me',
'person_module/he'])
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
......
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