[Erp5-report] r41130 nicolas - /erp5/trunk/products/ERP5OOo/tests/testDeferredStyle.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Sat Dec 4 16:41:36 CET 2010
Author: nicolas
Date: Sat Dec 4 16:41:35 2010
New Revision: 41130
URL: http://svn.erp5.org?rev=41130&view=rev
Log:
Even if the iteration succeeds, the test was failing.
'else' clause is triggered if there was no next item in the list.
Modified:
erp5/trunk/products/ERP5OOo/tests/testDeferredStyle.py
Modified: erp5/trunk/products/ERP5OOo/tests/testDeferredStyle.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testDeferredStyle.py?rev=41130&r1=41129&r2=41130&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDeferredStyle.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDeferredStyle.py [utf8] Sat Dec 4 16:41:35 2010
@@ -101,7 +101,9 @@ class TestDeferredStyle(ERP5TypeTestCase
mfrom, mto, message_text = last_message
self.assertEquals('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text)
+ failed = True
for part in mail_message.walk():
+ failed = False
content_type = part.get_content_type()
file_name = part.get_filename()
# "History" is the title of Base_viewHistory form
@@ -115,7 +117,7 @@ class TestDeferredStyle(ERP5TypeTestCase
if error_list:
self.fail(''.join(error_list))
break
- else:
+ if failed:
self.fail('Attachment not found in email')
def test_normal_form(self):
@@ -136,7 +138,9 @@ class TestDeferredStyle(ERP5TypeTestCase
mfrom, mto, message_text = last_message
self.assertEquals('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text)
+ failed = True
for part in mail_message.walk():
+ failed = False
content_type = part.get_content_type()
file_name = part.get_filename()
# "Person" is the title of Person_view form
@@ -150,7 +154,7 @@ class TestDeferredStyle(ERP5TypeTestCase
if error_list:
self.fail(''.join(error_list))
break
- else:
+ if failed:
self.fail('Attachment not found in email')
More information about the Erp5-report
mailing list