Commit 0a63361b authored by Nicolas Delaby's avatar Nicolas Delaby

Even if the iteration succeeds, the test was failing.

'else' clause is triggered if there was no next item in the list.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41130 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 994668c5
...@@ -101,7 +101,9 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -101,7 +101,9 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
mfrom, mto, message_text = last_message mfrom, mto, message_text = last_message
self.assertEquals('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0]) self.assertEquals('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text) mail_message = email.message_from_string(message_text)
failed = True
for part in mail_message.walk(): for part in mail_message.walk():
failed = False
content_type = part.get_content_type() content_type = part.get_content_type()
file_name = part.get_filename() file_name = part.get_filename()
# "History" is the title of Base_viewHistory form # "History" is the title of Base_viewHistory form
...@@ -115,7 +117,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -115,7 +117,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
if error_list: if error_list:
self.fail(''.join(error_list)) self.fail(''.join(error_list))
break break
else: if failed:
self.fail('Attachment not found in email') self.fail('Attachment not found in email')
def test_normal_form(self): def test_normal_form(self):
...@@ -136,7 +138,9 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -136,7 +138,9 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
mfrom, mto, message_text = last_message mfrom, mto, message_text = last_message
self.assertEquals('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0]) self.assertEquals('"%s" <%s>' % (self.first_name, self.recipient_email_address), mto[0])
mail_message = email.message_from_string(message_text) mail_message = email.message_from_string(message_text)
failed = True
for part in mail_message.walk(): for part in mail_message.walk():
failed = False
content_type = part.get_content_type() content_type = part.get_content_type()
file_name = part.get_filename() file_name = part.get_filename()
# "Person" is the title of Person_view form # "Person" is the title of Person_view form
...@@ -150,7 +154,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional): ...@@ -150,7 +154,7 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
if error_list: if error_list:
self.fail(''.join(error_list)) self.fail(''.join(error_list))
break break
else: if failed:
self.fail('Attachment not found in email') self.fail('Attachment not found in email')
......
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