[Erp5-report] r32062 nicolas - in /erp5/trunk/products/ERP5OOo: ./ tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jan 28 14:58:33 CET 2010


Author: nicolas
Date: Thu Jan 28 14:58:31 2010
New Revision: 32062

URL: http://svn.erp5.org?rev=32062&view=rev
Log:
 * charset=utf-8 is useless when FormPrintout return binary content
 * now Response headers are overloaded by FormPrintout calling
reviewed by Jerome

Modified:
    erp5/trunk/products/ERP5OOo/FormPrintout.py
    erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py

Modified: erp5/trunk/products/ERP5OOo/FormPrintout.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/FormPrintout.py?rev=32062&r1=32061&r2=32062&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/FormPrintout.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/FormPrintout.py [utf8] Thu Jan 28 14:58:31 2010
@@ -242,7 +242,7 @@
       format = REQUEST.get('format', None)
     if format is None:
       if REQUEST is not None:
-        REQUEST.RESPONSE.setHeader('Content-Type','%s; charset=utf-8' % content_type)
+        REQUEST.RESPONSE.setHeader('Content-Type','%s' % content_type)
         REQUEST.RESPONSE.setHeader('Content-disposition',
                                    'inline;filename="%s%s"' % (self.title_or_id(), guess_extension(content_type)))
       return printout

Modified: erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py?rev=32062&r1=32061&r2=32062&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testFormPrintoutAsODT.py [utf8] Thu Jan 28 14:58:31 2010
@@ -155,7 +155,7 @@
     content_xml = builder.extract("content.xml")
     self.assertTrue(content_xml.find("Foo title!") > 0)
     self.assertEqual(request.RESPONSE.getHeader('content-type'),
-                     'application/vnd.oasis.opendocument.text; charset=utf-8')
+                     'application/vnd.oasis.opendocument.text')
     self.assertEqual(request.RESPONSE.getHeader('content-disposition'),
                      'inline;filename="Foo_viewAsPrintout.odt"')
     self._validate(odf_document)
@@ -206,8 +206,7 @@
     builder = OOoBuilder(odf_document)
     content_xml = builder.extract("content.xml")
     self.assertTrue(content_xml.find("call!") > 0)
-    # when just call FormPrintout, it does not change content-type
-    self.assertEqual(request.RESPONSE.getHeader('content-type'), 'text/html')
+    self.assertEqual(request.RESPONSE.getHeader('content-type'), 'application/vnd.oasis.opendocument.text')
     self._validate(odf_document)
 
     # 5. Normal case: utf-8 string




More information about the Erp5-report mailing list