diff --git a/product/ERP5/Tool/NotificationTool.py b/product/ERP5/Tool/NotificationTool.py index cbb74d92e41d39d3a6def06356b8c4a151785dc8..56c8173b5c6c965bed937b19febaeb55c4de4cdc 100644 --- a/product/ERP5/Tool/NotificationTool.py +++ b/product/ERP5/Tool/NotificationTool.py @@ -68,8 +68,6 @@ def buildAttachmentDictList(document_list, document_type_list=()): # is not (yet) part of Document API if getattr(attachment, 'getContentType', None) is not None: mime_type = attachment.getContentType() - elif getattr(attachment, 'getTextFormat', None) is not None: - mime_type = attachment.getTextFormat() else: raise ValueError, "Cannot find mimetype of the document." @@ -350,7 +348,7 @@ class NotificationTool(BaseTool): event.setSourceValue(from_person) event.setDestinationValueList(to_person_list) event.setTitle(subject) - event.setTextFormat(message_text_format) + event.setContentType(message_text_format) event.setTextContent(message) event.setAggregateValueList(attachment_document_list) event_list.append(event) diff --git a/product/ERP5/tests/testEditorField.py b/product/ERP5/tests/testEditorField.py index c5be7435eda6e1ead4a0dccbe791a462d058fdf0..3eec9c4734da3af95dc127ce71b57cc39ebf1498 100644 --- a/product/ERP5/tests/testEditorField.py +++ b/product/ERP5/tests/testEditorField.py @@ -196,7 +196,7 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional): # Create an event event = self.event_module.newContent(portal_type='Note') text_content = """<p>Hé Hé\nHo Ho\nHi Hi</p>""" - event.setTextFormat('text/html') + event.setContentType('text/html') event.setTextContent(text_content) # Set FCKEditor as preferred editor and make sure it is taken into account @@ -226,7 +226,7 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional): # Create an event event = self.event_module.newContent(portal_type='Note') text_content = """Hé Hé\nHo Ho\nHi Hi""" - event.setTextFormat('text/plain') + event.setContentType('text/plain') event.setTextContent(text_content) # Set FCKEditor as preferred editor and make sure text_area is used since @@ -257,7 +257,7 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional): # Create an event event = self.event_module.newContent(portal_type='Note') text_content = """<p>Hé Hé\nHo Ho\nHi Hi</p>""" - event.setTextFormat('text/html') + event.setContentType('text/html') event.setTextContent(text_content) # Set TextArea as preferred editor and make sure it is taken into account @@ -288,7 +288,7 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional): # Create an event event = self.event_module.newContent(portal_type='Note') text_content = """Hé Hé\nHo Ho\nHi Hi""" - event.setTextFormat('text/plain') + event.setContentType('text/plain') event.setTextContent(text_content) # Set TextArea as preferred editor and make sure it is taken into account @@ -316,7 +316,7 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional): # Create a web page page = self.web_page_module.newContent(portal_type='Web Page') text_content = """<p>Hé Hé\nHo Ho\nHi Hi</p>""" - page.setTextFormat('text/html') + page.setContentType('text/html') page.setTextContent(text_content) # Set FCKEditor as preferred editor and make sure it is taken into account @@ -338,7 +338,7 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional): # Create a web page page = self.web_page_module.newContent(portal_type='Web Page') text_content = """Hé Hé\nHo Ho\nHi Hi""" - page.setTextFormat('text/plain') + page.setContentType('text/plain') page.setTextContent(text_content) # Set FCKEditor as preferred editor and make sure it is taken into account @@ -360,7 +360,7 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional): # Create a web page page = self.web_page_module.newContent(portal_type='Web Page') text_content = """<p>Hé Hé\nHo Ho\nHi Hi</p>""" - page.setTextFormat('text/html') + page.setContentType('text/html') page.setTextContent(text_content) # Set TextArea as preferred editor and make sure it is taken into account @@ -382,7 +382,7 @@ class TestEditorField(ERP5TypeTestCase, ZopeTestCase.Functional): # Create a web page page = self.web_page_module.newContent(portal_type='Web Page') text_content = """Hé Hé\nHo Ho\nHi Hi""" - page.setTextFormat('text/plain') + page.setContentType('text/plain') page.setTextContent(text_content) # Set TextArea as preferred editor and make sure it is taken into account