Commit 5daa4ea7 authored by Arnaud Fontaine's avatar Arnaud Fontaine

testCRM: Fix random test failures when ingesting email with multiple 'To' addresses.

- {'destination_list': ['person_module/he', 'person_module/me'],
+ {'destination_list': ['person_module/me', 'person_module/he'],
parent 3d6fb7c5
...@@ -766,10 +766,11 @@ class TestCRMMailIngestion(BaseTestCRM): ...@@ -766,10 +766,11 @@ class TestCRMMailIngestion(BaseTestCRM):
self.assertEqual('text/plain', event.getContentType()) self.assertEqual('text/plain', event.getContentType())
self.assertEqual('message/rfc822', event._baseGetContentType()) self.assertEqual('message/rfc822', event._baseGetContentType())
# check if parsing of metadata from content is working # check if parsing of metadata from content is working
content_dict = {'source_list': ['person_module/sender'], content_dict = event.getPropertyDictFromContent()
'destination_list': ['person_module/me', self.assertEqual(sorted(list(content_dict)), ['destination_list', 'source_list'])
'person_module/he']} self.assertEqual(content_dict['source_list'], ['person_module/sender'])
self.assertEqual(event.getPropertyDictFromContent(), content_dict) self.assertEqual(sorted(content_dict['destination_list']),
['person_module/he', 'person_module/me'])
def test_title(self): def test_title(self):
# title is found automatically, based on the Subject: header in the mail # title is found automatically, based on the Subject: header in the mail
...@@ -810,10 +811,11 @@ class TestCRMMailIngestion(BaseTestCRM): ...@@ -810,10 +811,11 @@ class TestCRMMailIngestion(BaseTestCRM):
self.assertEqual('text/plain', event.getContentType()) self.assertEqual('text/plain', event.getContentType())
self.assertEqual('message/rfc822', event._baseGetContentType()) self.assertEqual('message/rfc822', event._baseGetContentType())
# check if parsing of metadata from content is working # check if parsing of metadata from content is working
content_dict = {'source_list': ['person_module/sender'], content_dict = event.getPropertyDictFromContent()
'destination_list': ['person_module/me', self.assertEqual(sorted(list(content_dict)), ['destination_list', 'source_list'])
'person_module/he']} self.assertEqual(content_dict['source_list'], ['person_module/sender'])
self.assertEqual(event.getPropertyDictFromContent(), content_dict) self.assertEqual(sorted(content_dict['destination_list']),
['person_module/he', 'person_module/me'])
new_event = event.Base_createCloneDocument(batch_mode=1) new_event = event.Base_createCloneDocument(batch_mode=1)
self.tic() self.tic()
self.assertEqual('Simple Mail Test', new_event.getTitle()) self.assertEqual('Simple Mail Test', new_event.getTitle())
...@@ -825,8 +827,8 @@ class TestCRMMailIngestion(BaseTestCRM): ...@@ -825,8 +827,8 @@ class TestCRMMailIngestion(BaseTestCRM):
# check that metadatas read from data are copied on cloned event # check that metadatas read from data are copied on cloned event
self.assertEqual(new_event.getSourceList(), ['person_module/sender']) self.assertEqual(new_event.getSourceList(), ['person_module/sender'])
self.assertEqual(new_event.getDestinationList(), ['person_module/me', self.assertEqual(sorted(new_event.getDestinationList()),
'person_module/he']) ['person_module/he', 'person_module/me'])
# cloned event got a new reference # cloned event got a new reference
self.assertNotEqual(new_event.getReference(), event.getReference()) self.assertNotEqual(new_event.getReference(), event.getReference())
......
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