Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_FSDTMLMethod.FSDTMLMethodTests Class Reference
Inheritance diagram for CMFCore.tests.test_FSDTMLMethod.FSDTMLMethodTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_FSDTMLMethod.FSDTMLMethodTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown
def test_Call
def test_caching
def test_ownership
def test_304_response_from_cpm

Private Member Functions

def _setupCachingPolicyManager

Detailed Description

Definition at line 48 of file test_FSDTMLMethod.py.


Member Function Documentation

Definition at line 59 of file test_FSDTMLMethod.py.

00059 
00060     def _setupCachingPolicyManager(self, cpm_object):
00061         self.root.caching_policy_manager = cpm_object

Here is the caller graph for this function:

Definition at line 50 of file test_FSDTMLMethod.py.

00050 
00051     def setUp(self):
00052         FSDTMLMaker.setUp(self)
00053         RequestTest.setUp(self)
00054         setHooks()

Definition at line 55 of file test_FSDTMLMethod.py.

00055 
00056     def tearDown(self):
00057         RequestTest.tearDown(self)
00058         FSDTMLMaker.tearDown(self)

Definition at line 90 of file test_FSDTMLMethod.py.

00090 
00091     def test_304_response_from_cpm( self ):
00092         # test that we get a 304 response from the cpm via this template
00093 
00094         from webdav.common import rfc1123_date
00095 
00096         mod_time = DateTime()
00097         self._setupCachingPolicyManager(DummyCachingManagerWithPolicy())
00098         content = DummyContent(id='content')
00099         content.modified_date = mod_time
00100         content = content.__of__(self.root)
00101         script = self._makeOne('testDTML', 'testDTML.dtml')
00102         script = script.__of__(content)
00103         self.REQUEST.environ[ 'IF_MODIFIED_SINCE'
00104                             ] = '%s;' % rfc1123_date( mod_time+3600 )
00105         data = script(content, self.REQUEST, self.RESPONSE)
00106 
00107         self.assertEqual( data, '' )
00108         self.assertEqual( self.RESPONSE.getStatus(), 304 )

Here is the call graph for this function:

Definition at line 67 of file test_FSDTMLMethod.py.

00067 
00068     def test_caching( self ):
00069         #   Test HTTP caching headers.
00070         self._setupCachingPolicyManager(DummyCachingManager())
00071         original_len = len( self.RESPONSE.headers )
00072         script = self._makeOne('testDTML', 'testDTML.dtml')
00073         script = script.__of__(self.root)
00074         script(self.root, self.REQUEST, self.RESPONSE)
00075         self.failUnless( len( self.RESPONSE.headers ) >= original_len + 2 )
00076         self.failUnless( 'foo' in self.RESPONSE.headers.keys() )
00077         self.failUnless( 'bar' in self.RESPONSE.headers.keys() )

Here is the call graph for this function:

Definition at line 62 of file test_FSDTMLMethod.py.

00062 
00063     def test_Call( self ):
00064         script = self._makeOne( 'testDTML', 'testDTML.dtml' )
00065         script = script.__of__(self.app)
00066         self.assertEqual(script(self.app, self.REQUEST), 'nohost\n')

Here is the call graph for this function:

Definition at line 78 of file test_FSDTMLMethod.py.

00078 
00079     def test_ownership( self ):
00080         script = self._makeOne( 'testDTML', 'testDTML.dtml' )
00081         script = script.__of__(self.root)
00082         # fsdtmlmethod has no owner
00083         owner_tuple = script.getOwnerTuple()
00084         self.assertEqual(owner_tuple, None)
00085 
00086         # and ownership is not acquired [CMF/450]
00087         self.root._owner= ('/foobar', 'baz')
00088         owner_tuple = script.getOwnerTuple()
00089         self.assertEqual(owner_tuple, None)

Here is the call graph for this function:


The documentation for this class was generated from the following file: