[Erp5-report] r39704 nicolas - /erp5/trunk/products/ERP5OOo/tests/testDms.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 29 16:33:17 CEST 2010


Author: nicolas
Date: Fri Oct 29 16:33:15 2010
New Revision: 39704

URL: http://svn.erp5.org?rev=39704&view=rev
Log:
Output smarter message to understand conversion issue.

Modified:
    erp5/trunk/products/ERP5OOo/tests/testDms.py

Modified: erp5/trunk/products/ERP5OOo/tests/testDms.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testDms.py?rev=39704&r1=39703&r2=39704&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] Fri Oct 29 16:33:15 2010
@@ -70,6 +70,7 @@ import os
 from threading import Thread
 import httplib
 import urllib
+import difflib
 from AccessControl import Unauthorized
 from Products.ERP5Type import Permissions
 from Products.ERP5Type.tests.backportUnittest import expectedFailure
@@ -625,7 +626,13 @@ class TestDocument(TestDocumentMixin):
     self.assertEquals('application/pdf', response.getHeader('content-type'))
     self.assertEquals('attachment; filename="import.file.with.dot.in.filename.pdf"',
                       response.getHeader('content-disposition'))
-    self.assertEquals(response.getBody(), str(doc.convert('pdf')[1]))
+    response_body = response.getBody()
+    conversion = str(doc.convert('pdf')[1])
+    diff = '\n'+'\n'.join(difflib.unified_diff(response_body.splitlines(),
+                                          conversion.splitlines(),
+                                          fromfile='first_call.pdf',
+                                          tofile='second_call.pdf'))
+    self.assertEquals(response_body, conversion, diff)
 
     # test Print icon works on OOoDocument
     response = self.publish('%s/OOoDocument_print' % doc.getPath())




More information about the Erp5-report mailing list