Commit 4eb2db77 authored by Nicolas Delaby's avatar Nicolas Delaby

reponse has an API, use it

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35268 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 781af4fa
...@@ -600,7 +600,7 @@ class TestDocument(TestDocumentMixin): ...@@ -600,7 +600,7 @@ class TestDocument(TestDocumentMixin):
response = self.publish('%s/Base_download' % doc.getPath(), response = self.publish('%s/Base_download' % doc.getPath(),
basic='member_user1:secret') basic='member_user1:secret')
self.assertEquals(makeFileUpload('import_data_list.ods').read(), self.assertEquals(makeFileUpload('import_data_list.ods').read(),
response.body) response.getBody())
self.assertEquals('application/vnd.oasis.opendocument.spreadsheet', self.assertEquals('application/vnd.oasis.opendocument.spreadsheet',
response.headers['content-type']) response.headers['content-type'])
self.assertEquals('attachment; filename="import_data_list.ods"', self.assertEquals('attachment; filename="import_data_list.ods"',
...@@ -626,9 +626,10 @@ class TestDocument(TestDocumentMixin): ...@@ -626,9 +626,10 @@ class TestDocument(TestDocumentMixin):
response = self.publish('%s/Document_convert?format=pdf' % doc.getPath(), response = self.publish('%s/Document_convert?format=pdf' % doc.getPath(),
basic='member_user2:secret') basic='member_user2:secret')
self.assertEquals('application/pdf', response.headers['content-type']) self.assertEquals('application/pdf', response.getHeader('content-type'))
self.assertEquals('attachment; filename="import.file.with.dot.in.filename.pdf"', self.assertEquals('attachment; filename="import.file.with.dot.in.filename.pdf"',
response.headers['content-disposition']) response.getHeader('content-disposition'))
self.assertEquals(response.getBody(), str(doc.convert('pdf')[1]))
# test Print icon works on OOoDocument # test Print icon works on OOoDocument
response = self.publish('%s/OOoDocument_print' % doc.getPath()) 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