[Erp5-report] r32796 romain - in /erp5/trunk/products/ERP5OOo: Document/ tests/ tests/test_...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Feb 18 16:30:10 CET 2010


Author: romain
Date: Thu Feb 18 16:30:08 2010
New Revision: 32796

URL: http://svn.erp5.org?rev=32796&view=rev
Log:
Do not truncate filename when it contains a dot.

Added:
    erp5/trunk/products/ERP5OOo/tests/test_document/import.file.with.dot.in.filename.ods   (with props)
Modified:
    erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
    erp5/trunk/products/ERP5OOo/tests/testDms.py

Modified: erp5/trunk/products/ERP5OOo/Document/OOoDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/Document/OOoDocument.py?rev=32796&r1=32795&r2=32796&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/Document/OOoDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/Document/OOoDocument.py [utf8] Thu Feb 18 16:30:08 2010
@@ -204,7 +204,7 @@
       raise NotConvertedError
     # Else try to convert the document and return it
     mime, result = self.convert(format=format, display=display, **kw)
-    converted_filename = '%s.%s'%(filename.split('.')[0],  format)
+    converted_filename = '%s.%s'%('.'.join(filename.split('.')[:-1]),  format)
     if not mime:
       mime = getToolByName(self, 'mimetypes_registry').lookupExtension('name.%s' % format)
     RESPONSE.setHeader('Content-Length', len(result))

Modified: erp5/trunk/products/ERP5OOo/tests/testDms.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testDms.py?rev=32796&r1=32795&r2=32796&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testDms.py [utf8] Thu Feb 18 16:30:08 2010
@@ -595,7 +595,7 @@
     doc = self.portal.document_module.newContent(
                                   source_reference='test.ods',
                                   portal_type='Spreadsheet')
-    doc.edit(file=makeFileUpload('import_data_list.ods'))
+    doc.edit(file=makeFileUpload('import.file.with.dot.in.filename.ods'))
     doc.publish()
     transaction.commit()
     self.tic()
@@ -609,14 +609,14 @@
     response = self.publish('%s/Document_convert?format=pdf' % doc.getPath(),
                             basic='member_user2:secret')
     self.assertEquals('application/pdf', response.headers['content-type'])
-    self.assertEquals('attachment; filename="import_data_list.pdf"',
+    self.assertEquals('attachment; filename="import.file.with.dot.in.filename.pdf"',
                       response.headers['content-disposition'])
 
     # test Print icon works on OOoDocument
     response = self.publish('%s/OOoDocument_print' % doc.getPath())
     self.assertEquals('application/pdf',
                       response.headers['content-type'])
-    self.assertEquals('attachment; filename="import_data_list.pdf"',
+    self.assertEquals('attachment; filename="import.file.with.dot.in.filename.pdf"',
                       response.headers['content-disposition'])
 
   def test_05_getCreationDate(self):

Added: erp5/trunk/products/ERP5OOo/tests/test_document/import.file.with.dot.in.filename.ods
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/import.file.with.dot.in.filename.ods?rev=32796&view=auto
==============================================================================
Binary file - no diff available.

Propchange: erp5/trunk/products/ERP5OOo/tests/test_document/import.file.with.dot.in.filename.ods
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream




More information about the Erp5-report mailing list