[CMF-checkins] CVS: CMF/CMFCore/tests - test_FSPageTemplate.py:1.9

Florent Guillaume fg@nuxeo.com
Thu, 5 Sep 2002 16:45:27 -0400


Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv403/tests

Modified Files:
	test_FSPageTemplate.py 
Log Message:
Ensured a user-sent content-type is correctly kept.
Added a test to check for that.


=== CMF/CMFCore/tests/test_FSPageTemplate.py 1.8 => 1.9 ===
--- CMF/CMFCore/tests/test_FSPageTemplate.py:1.8	Mon Aug 19 13:29:32 2002
+++ CMF/CMFCore/tests/test_FSPageTemplate.py	Thu Sep  5 16:45:26 2002
@@ -38,11 +38,19 @@
         script()
         self.assertEqual(script.content_type, 'text/xml')
         self.assertEqual(self.RESPONSE.getHeader('content-type'), 'text/xml')
+        # purge RESPONSE Content-Type header for new test
+        del self.RESPONSE.headers['content-type']
         script = self._makeOne( 'testPT', 'testPT.pt' )
         script = script.__of__(self.root)
         script()
         self.assertEqual(script.content_type, 'text/html')
         self.assertEqual(self.RESPONSE.getHeader('content-type'), 'text/html')
+
+    def test_ContentTypeOverride(self):
+        script = self._makeOne( 'testPT_utf8', 'testPT_utf8.pt' )
+        script = script.__of__(self.root)
+        script()
+        self.assertEqual(self.RESPONSE.getHeader('content-type'), 'text/html; charset=utf-8')
 
     def test_BadCall( self ):