Commit a277011c authored by Nicolas Delaby's avatar Nicolas Delaby

Output smarter message to understand conversion issue.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39704 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0480ee9e
......@@ -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())
......
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