Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
CMFCore.tests.test_FSReSTMethod.FSReSTMethodTests Class Reference
Inheritance diagram for CMFCore.tests.test_FSReSTMethod.FSReSTMethodTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_FSReSTMethod.FSReSTMethodTests:
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

Static Public Attributes

 layer = TraversingZCMLLayer

Detailed Description

Definition at line 81 of file test_FSReSTMethod.py.


Member Function Documentation

Reimplemented from CMFCore.tests.test_FSReSTMethod.FSReSTMaker.

Definition at line 85 of file test_FSReSTMethod.py.

00085 
00086     def setUp(self):
00087         RequestTest.setUp(self)
00088         FSReSTMaker.setUp(self)

Definition at line 89 of file test_FSReSTMethod.py.

00089 
00090     def tearDown(self):
00091         FSReSTMaker.tearDown(self)
00092         RequestTest.tearDown(self)

Definition at line 123 of file test_FSReSTMethod.py.

00123 
00124     def test_304_response_from_cpm( self ):
00125         # test that we get a 304 response from the cpm via this template
00126         from DateTime import DateTime
00127         from webdav.common import rfc1123_date
00128         from Products.CMFCore.tests.base.dummy \
00129             import DummyCachingManagerWithPolicy
00130 
00131         mod_time = DateTime()
00132         self.root.caching_policy_manager = DummyCachingManagerWithPolicy()
00133         script = self._makeOne('testReST', 'testReST.rst')
00134         script = script.__of__(self.root)
00135         self.REQUEST.environ[ 'IF_MODIFIED_SINCE'
00136                             ] = '%s;' % rfc1123_date( mod_time+3600 )
00137         data = script(self.REQUEST, self.RESPONSE)
00138 
00139         self.assertEqual( data, '' )
00140         self.assertEqual( self.RESPONSE.getStatus(), 304 )
00141 

Here is the call graph for this function:

Definition at line 93 of file test_FSReSTMethod.py.

00093 
00094     def test___call__( self ):
00095         script = self._makeOne( 'testReST', 'testReST.rst' )
00096         script = script.__of__(self.app)
00097         self.assertEqual(_normalize_whitespace(script(self.REQUEST)),
00098                          _normalize_whitespace(_EXPECTED_HTML))

Here is the call graph for this function:

Definition at line 99 of file test_FSReSTMethod.py.

00099 
00100     def test_caching( self ):
00101         #   Test HTTP caching headers.
00102         from Products.CMFCore.tests.base.dummy import DummyCachingManager
00103         self.root.caching_policy_manager = DummyCachingManager()
00104         original_len = len( self.RESPONSE.headers )
00105         script = self._makeOne('testReST', 'testReST.rst')
00106         script = script.__of__(self.root)
00107         script(self.REQUEST, self.RESPONSE)
00108         self.failUnless( len( self.RESPONSE.headers ) >= original_len + 2 )
00109         self.failUnless( 'foo' in self.RESPONSE.headers.keys() )
00110         self.failUnless( 'bar' in self.RESPONSE.headers.keys() )

Here is the call graph for this function:

Definition at line 111 of file test_FSReSTMethod.py.

00111 
00112     def test_ownership( self ):
00113         script = self._makeOne( 'testReST', 'testReST.rst' )
00114         script = script.__of__(self.root)
00115         # FSReSTMethod has no owner
00116         owner_tuple = script.getOwnerTuple()
00117         self.assertEqual(owner_tuple, None)
00118 
00119         # and ownership is not acquired [CMF/450]
00120         self.root._owner= ('/foobar', 'baz')
00121         owner_tuple = script.getOwnerTuple()
00122         self.assertEqual(owner_tuple, None)

Here is the call graph for this function:


Member Data Documentation

Definition at line 83 of file test_FSReSTMethod.py.


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