Commit c2c05052 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Fix TestCRMMailIngestion: use core rfc822 Python module instead of adhoc code


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33514 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9911322d
...@@ -53,18 +53,12 @@ ...@@ -53,18 +53,12 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>getResultValue = context.portal_catalog.getResultValue\n
\n
getResultValue = context.portal_catalog.getResultValue\n from Products.ERP5Type.Utils import Email_parseAddressHeader\n
\n \n
result = []\n result = []\n
for recipient in text.split(\',\'):\n for name, recipient in Email_parseAddressHeader(text):\n
if "<" in recipient:\n
recipient = recipient[recipient.find(\'<\') + 1:]\n
recipient = recipient[:recipient.find(\'>\')]\n
else:\n
# Remove extra spaces.\n
recipient = recipient.strip()\n
if recipient:\n if recipient:\n
email = getResultValue(url_string={\'query\':recipient, \'key\':\'ExactMatch\'}, portal_type=\'Email\', parent_portal_type=\'Person\')\n email = getResultValue(url_string={\'query\':recipient, \'key\':\'ExactMatch\'}, portal_type=\'Email\', parent_portal_type=\'Person\')\n
if email is None:\n if email is None:\n
...@@ -72,9 +66,7 @@ for recipient in text.split(\',\'):\n ...@@ -72,9 +66,7 @@ for recipient in text.split(\',\'):\n
if email is not None:\n if email is not None:\n
result.append(email.getParentValue())\n result.append(email.getParentValue())\n
return result\n return result\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -114,10 +106,12 @@ return result\n ...@@ -114,10 +106,12 @@ return result\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>getResultValue</string> <string>getResultValue</string>
<string>Products.ERP5Type.Utils</string>
<string>Email_parseAddressHeader</string>
<string>result</string> <string>result</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>name</string>
<string>recipient</string> <string>recipient</string>
<string>_getitem_</string>
<string>email</string> <string>email</string>
<string>None</string> <string>None</string>
</tuple> </tuple>
......
458 459
\ No newline at end of file \ No newline at end of file
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