Commit fe7535e5 authored by Yoshinori Okuji's avatar Yoshinori Okuji

w3m_dump seems to want to append a newline from time to time, so make it sure...

w3m_dump seems to want to append a newline from time to time, so make it sure to ignore if the text ends with a newline or not by stripping.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33794 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b63ba4ce
...@@ -126,7 +126,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase): ...@@ -126,7 +126,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase):
mime, text = doc.convert('txt') mime, text = doc.convert('txt')
self.assertEqual('text/plain', mime) self.assertEqual('text/plain', mime)
self.assertEqual('substitution text: b', text) self.assertEqual('substitution text: b', text.rstrip())
self.assertEqual('Test b', doc.asSubjectText()) self.assertEqual('Test b', doc.asSubjectText())
...@@ -147,7 +147,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase): ...@@ -147,7 +147,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase):
mime, text = doc.convert('txt', mime, text = doc.convert('txt',
substitution_method_parameter_dict=dict(a='b')) substitution_method_parameter_dict=dict(a='b'))
self.assertEqual('substitution text: b', text) self.assertEqual('substitution text: b', text.rstrip())
def test_substitution_content_and_convert(self): def test_substitution_content_and_convert(self):
...@@ -165,7 +165,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase): ...@@ -165,7 +165,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase):
'NotificationMessage_getDummySubstitionMapping') 'NotificationMessage_getDummySubstitionMapping')
mime, text = doc.convert('txt') mime, text = doc.convert('txt')
self.assertEqual('substitution text: b', text) self.assertEqual('substitution text: b', text.rstrip())
def test_safe_substitution_content(self): def test_safe_substitution_content(self):
"""Tests that 'safe' substitution is performed, unless safe_substitute is """Tests that 'safe' substitution is performed, unless safe_substitute is
...@@ -183,7 +183,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase): ...@@ -183,7 +183,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase):
'NotificationMessage_getDummySubstitionMapping') 'NotificationMessage_getDummySubstitionMapping')
mime, text = doc.convert('txt') mime, text = doc.convert('txt')
self.assertEqual('substitution text: ${b}', text) self.assertEqual('substitution text: ${b}', text.rstrip())
self.assertEqual('${b}', doc.asSubjectText()) self.assertEqual('${b}', doc.asSubjectText())
self.assertRaises(KeyError, doc.convert, 'txt', safe_substitute=False) self.assertRaises(KeyError, doc.convert, 'txt', safe_substitute=False)
......
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