[Checkins] SVN:	Products.CMFDefault/trunk/Products/CMFDefault/tests/test_ -	removed unnecessary transaction.commit()
    Yvo Schubbe 
    y.2011 at wcm-solutions.de
       
    Mon Feb 13 09:12:58 UTC 2012
    
    
  
Log message for revision 124383:
  - removed unnecessary transaction.commit()
Changed:
  U   Products.CMFDefault/trunk/Products/CMFDefault/tests/test_File.py
  U   Products.CMFDefault/trunk/Products/CMFDefault/tests/test_Image.py
-=-
Modified: Products.CMFDefault/trunk/Products/CMFDefault/tests/test_File.py
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/tests/test_File.py	2012-02-13 08:25:05 UTC (rev 124382)
+++ Products.CMFDefault/trunk/Products/CMFDefault/tests/test_File.py	2012-02-13 09:12:58 UTC (rev 124383)
@@ -18,7 +18,6 @@
 
 from os.path import join as path_join
 
-import transaction
 from App.Common import rfc1123_date
 from zope.component import getSiteManager
 from zope.interface.verify import verifyClass
@@ -175,17 +174,11 @@
         cpm = LMDummyCachingManager()
         getSiteManager().registerUtility(cpm, ICachingPolicyManager)
 
-        obj = self._makeOne('test_file', 'test_file.swf', file=ref)
+        self.app.foo = self._makeOne('test_file', 'test_file.swf', file=ref)
 
-        # Cause persistent's modified time record to be set
-        self.app.foo = obj
-        transaction.commit()
-        obj = self.app.foo
-        # end
+        # index_html in OFS will set Last-Modified to ._p_mtime or current time
+        self.app.foo.index_html(self.REQUEST, self.RESPONSE)
 
-        # index_html in OFS will set Last-modified if ._p_mtime exists
-        obj.index_html(self.REQUEST, self.RESPONSE)
-
         headers = self.RESPONSE.headers
         self.assertEqual(headers['last-modified'],
                          "Sun, 06 Nov 1994 08:49:37 GMT")
Modified: Products.CMFDefault/trunk/Products/CMFDefault/tests/test_Image.py
===================================================================
--- Products.CMFDefault/trunk/Products/CMFDefault/tests/test_Image.py	2012-02-13 08:25:05 UTC (rev 124382)
+++ Products.CMFDefault/trunk/Products/CMFDefault/tests/test_Image.py	2012-02-13 09:12:58 UTC (rev 124383)
@@ -306,17 +306,11 @@
         cpm = LMDummyCachingManager()
         getSiteManager().registerUtility(cpm, ICachingPolicyManager)
 
-        obj = self._makeOne('test_image', 'test_image.gif', file=ref)
+        self.app.foo = self._makeOne('test_image', 'test_image.gif', file=ref)
 
-        # Cause persistent's modified time record to be set
-        self.app.foo = obj
-        transaction.commit()
-        obj = self.app.foo
-        # end
+        # index_html in OFS will set Last-Modified to ._p_mtime or current time
+        self.app.foo.index_html(self.REQUEST, self.RESPONSE)
 
-        # index_html in OFS will set Last-modified if ._p_mtime exists
-        obj.index_html(self.REQUEST, self.RESPONSE)
-
         headers = self.RESPONSE.headers
         self.assertEqual(headers['last-modified'],
                          "Sun, 06 Nov 1994 08:49:37 GMT")
    
    
More information about the checkins
mailing list