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

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


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

Modified Files:
      Tag: CMF-1_3-branch
	test_FSPageTemplate.py 
Log Message:
Backport from HEAD:
Ensured a user-sent content-type is correctly kept.
Added a test to check for that.


=== CMF/CMFCore/tests/test_FSPageTemplate.py 1.6.4.1 => 1.6.4.2 ===
--- CMF/CMFCore/tests/test_FSPageTemplate.py:1.6.4.1	Thu Aug  1 09:51:40 2002
+++ CMF/CMFCore/tests/test_FSPageTemplate.py	Thu Sep  5 16:56:18 2002
@@ -31,11 +31,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 ):