From fe7535e59a59b7e4529ddf858fc1e6aedebbf917 Mon Sep 17 00:00:00 2001
From: Yoshinori Okuji <yo@nexedi.com>
Date: Wed, 17 Mar 2010 12:00:47 +0000
Subject: [PATCH] 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
---
 product/ERP5/tests/testNotificationMessageModule.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/product/ERP5/tests/testNotificationMessageModule.py b/product/ERP5/tests/testNotificationMessageModule.py
index 4322691b05..a8e1ec2044 100644
--- a/product/ERP5/tests/testNotificationMessageModule.py
+++ b/product/ERP5/tests/testNotificationMessageModule.py
@@ -126,7 +126,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase):
 
     mime, text = doc.convert('txt')
     self.assertEqual('text/plain', mime)
-    self.assertEqual('substitution text: b', text)
+    self.assertEqual('substitution text: b', text.rstrip())
 
     self.assertEqual('Test b', doc.asSubjectText())
 
@@ -147,7 +147,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase):
 
     mime, text = doc.convert('txt',
                              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):
@@ -165,7 +165,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase):
                             'NotificationMessage_getDummySubstitionMapping')
 
     mime, text = doc.convert('txt')
-    self.assertEqual('substitution text: b', text)
+    self.assertEqual('substitution text: b', text.rstrip())
 
   def test_safe_substitution_content(self):
     """Tests that 'safe' substitution is performed, unless safe_substitute is
@@ -183,7 +183,7 @@ class TestNotificationMessageModule(ERP5TypeTestCase):
                             'NotificationMessage_getDummySubstitionMapping')
 
     mime, text = doc.convert('txt')
-    self.assertEqual('substitution text: ${b}', text)
+    self.assertEqual('substitution text: ${b}', text.rstrip())
     self.assertEqual('${b}', doc.asSubjectText())
 
     self.assertRaises(KeyError, doc.convert, 'txt', safe_substitute=False)
-- 
2.30.9