[CMF-checkins] CVS: Products/CMFDefault/tests -
test_Image.py:1.4.40.2
Stefan H. Holek
stefan at epy.co.at
Tue Jul 27 17:35:16 EDT 2004
Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv20985/CMFDefault/tests
Modified Files:
Tag: CMF-1_4-branch
test_Image.py
Log Message:
Fix for DC.format and content_type running out of sync in Image and File.
=== Products/CMFDefault/tests/test_Image.py 1.4.40.1 => 1.4.40.2 ===
--- Products/CMFDefault/tests/test_Image.py:1.4.40.1 Thu Apr 22 13:47:55 2004
+++ Products/CMFDefault/tests/test_Image.py Tue Jul 27 17:35:15 2004
@@ -3,6 +3,7 @@
import os, cStringIO
+from Products.CMFDefault.File import File
from Products.CMFDefault.Image import Image
from Products.CMFDefault import tests
@@ -28,6 +29,25 @@
assert image.get_size() > 0
assert image.get_size() == testfilesize
+
+ def test_File_setFormat(self):
+ """ Setting the format must also set the content_type property """
+ file = File('testfile', format='image/jpeg')
+ self.assertEqual(file.Format(), 'image/jpeg')
+ self.assertEqual(file.content_type, 'image/jpeg')
+ file.setFormat('image/gif')
+ self.assertEqual(file.Format(), 'image/gif')
+ self.assertEqual(file.content_type, 'image/gif')
+
+ def test_Image_setFormat(self):
+ """ Setting the format must also set the content_type property """
+ image = Image('testimage', format='image/jpeg')
+ self.assertEqual(image.Format(), 'image/jpeg')
+ self.assertEqual(image.content_type, 'image/jpeg')
+ image.setFormat('image/gif')
+ self.assertEqual(image.Format(), 'image/gif')
+ self.assertEqual(image.content_type, 'image/gif')
+
def test_suite():
return TestSuite((
More information about the CMF-checkins
mailing list