Commit 72dfe4a0 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

modify assertions to get more meaningful errors in case of failure.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41383 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0e26fd0c
......@@ -104,11 +104,12 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
for part in mail_message.walk():
content_type = part.get_content_type()
file_name = part.get_filename()
# "History" is the title of Base_viewHistory form
if file_name == 'History%s' % self.attachment_file_extension:
self.assertEquals(content_type, self.content_type)
self.assertEquals('attachment; filename="History%s"' %
self.attachment_file_extension,
if content_type == self.content_type:
# "History" is the title of Base_viewHistory form
file_name = part.get_filename()
expected_file_name = 'History%s' % self.attachment_file_extension
self.assertEquals(expected_file_name, file_name)
self.assertEquals('attachment; filename="%s"' % expected_file_name,
part.get('Content-Disposition'))
data = part.get_payload(decode=True)
error_list = Validator().validate(data)
......@@ -138,12 +139,12 @@ class TestDeferredStyle(ERP5TypeTestCase, ZopeTestCase.Functional):
mail_message = email.message_from_string(message_text)
for part in mail_message.walk():
content_type = part.get_content_type()
file_name = part.get_filename()
# "Person" is the title of Person_view form
if file_name == 'Person%s' % self.attachment_file_extension:
self.assertEquals(content_type, self.content_type)
self.assertEquals('attachment; filename="Person%s"' %
self.attachment_file_extension,
if content_type == self.content_type:
# "Person" is the title of Person_view form
file_name = part.get_filename()
expected_file_name = 'Person%s' % self.attachment_file_extension
self.assertEquals(expected_file_name, file_name)
self.assertEquals('attachment; filename="%s"' % expected_file_name,
part.get('Content-Disposition'))
data = part.get_payload(decode=True)
error_list = Validator().validate(data)
......
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