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 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
getResultValue = context.portal_catalog.getResultValue\n
<value> <string>getResultValue = context.portal_catalog.getResultValue\n
\n
from Products.ERP5Type.Utils import Email_parseAddressHeader\n
\n
result = []\n
for recipient in text.split(\',\'):\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
for name, recipient in Email_parseAddressHeader(text):\n
if recipient:\n
email = getResultValue(url_string={\'query\':recipient, \'key\':\'ExactMatch\'}, portal_type=\'Email\', parent_portal_type=\'Person\')\n
if email is None:\n
......@@ -72,9 +66,7 @@ for recipient in text.split(\',\'):\n
if email is not None:\n
result.append(email.getParentValue())\n
return result\n
]]></string> </value>
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -114,10 +106,12 @@ return result\n
<string>_getattr_</string>
<string>context</string>
<string>getResultValue</string>
<string>Products.ERP5Type.Utils</string>
<string>Email_parseAddressHeader</string>
<string>result</string>
<string>_getiter_</string>
<string>name</string>
<string>recipient</string>
<string>_getitem_</string>
<string>email</string>
<string>None</string>
</tuple>
......
458
\ No newline at end of file
459
\ 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