[CMF-checkins] CVS: CMF/CMFCore/tests - test_CachingPolicyManager.py:1.5

Tres Seaver tseaver@zope.com
Thu, 4 Apr 2002 17:28:32 -0500


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

Modified Files:
	test_CachingPolicyManager.py 
Log Message:


  - Remove weird dependencies on time-of-testing by adding ability to
    pass optional, explict request time as part of the exprContext (should
    only normally be used by testing).


=== CMF/CMFCore/tests/test_CachingPolicyManager.py 1.4 => 1.5 ===
 
     def setUp(self):
-        self.EPOCH = DateTime()
+        self.EPOCH = DateTime( '1970/01/01' )
 
     def _makePolicy( self, policy_id, **kw ):
 
@@ -34,7 +34,8 @@
 
         from Products.CMFCore.CachingPolicyManager import createCPContext
         from Products.CMFCore.CachingPolicyManager import createCPContext
-        return createCPContext( DummyContent(self.EPOCH), 'foo_view', kw )
+        return createCPContext( DummyContent(self.EPOCH)
+                              , 'foo_view', kw, self.EPOCH )
         
     def test_interface( self ):
         from Products.CMFCore.interfaces.CachingPolicyManager \
@@ -155,9 +156,11 @@
 
         self.assertEqual( len( headers ), 3 )
         self.assertEqual( headers[0][0].lower() , 'last-modified' )
-        self.assertEqual( headers[0][1] , rfc1123_date(self.EPOCH.timeTime()) )
+        self.assertEqual( headers[0][1]
+                        , rfc1123_date(self.EPOCH.timeTime()) )
         self.assertEqual( headers[1][0].lower() , 'expires' )
-        self.assertEqual( headers[1][1] , rfc1123_date((self.EPOCH+1).timeTime()) )
+        self.assertEqual( headers[1][1]
+                        , rfc1123_date((self.EPOCH+1).timeTime()) )
         self.assertEqual( headers[2][0].lower() , 'cache-control' )
         self.assertEqual( headers[2][1] , 'max-age=86400' )