[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/file/ Removed redundant functional tests for zope.app.file.

Marius Gedminas marius at pov.lt
Fri Jul 29 12:14:52 EDT 2005


Log message for revision 37548:
  Removed redundant functional tests for zope.app.file.
  
  zope.app.file had a small set of functional tests in zope.app.file.ftests
  (these were one of the very first ftests in Zope 3, IIRC -- I wrote them).
  Then later zope.app.file.browser.ftests appeared with a more extensive set
  of tests.
  
  I moved the only test for Image that was in the old zope.app.file.ftests
  package but was not present in zope.app.file.browser.ftests.  This test case
  reminds me of http://www.zope.org/Collectors/Zope3-dev/327
  
  

Changed:
  U   Zope3/trunk/src/zope/app/file/browser/ftests.py
  D   Zope3/trunk/src/zope/app/file/ftests/

-=-
Modified: Zope3/trunk/src/zope/app/file/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zope/app/file/browser/ftests.py	2005-07-29 15:59:53 UTC (rev 37547)
+++ Zope3/trunk/src/zope/app/file/browser/ftests.py	2005-07-29 16:14:51 UTC (rev 37548)
@@ -219,7 +219,25 @@
         image = root['image']
         self.assertEqual(image.data, '')
         self.assertEqual(image.contentType, 'image/gif')
-        
+
+    def testUpload_only_change_content_type(self):
+        self.addImage()
+        response = self.publish(
+            '/image/@@upload.html',
+            form={'field.contentType': 'image/png',
+                  'UPDATE_SUBMIT': u'Change'},
+            basic='mgr:mgrpw')
+        self.assertEqual(response.getStatus(), 200)
+        body = response.getBody()
+        self.assert_('Upload an image' in body)
+        self.assert_('Content Type' in body)
+        self.assert_('Data' in body)
+        self.assert_('1 KB 16x16' in body)
+        root = self.getRootFolder()
+        image = root['image']
+        self.assertEqual(image.data, self.content)
+        self.assertEqual(image.contentType, 'image/png')
+
     def testIndex(self):
         self.addImage()
         response = self.publish(



More information about the Zope3-Checkins mailing list