Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
CMFCore.tests.test_FSSTXMethod.FSSTXMethodTests Class Reference
Inheritance diagram for CMFCore.tests.test_FSSTXMethod.FSSTXMethodTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_FSSTXMethod.FSSTXMethodTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown
def test___call___with_DTML
def test___call___with_ZPT
def test_caching
def test_ownership
def test_304_response_from_cpm

Static Public Attributes

 layer = TraversingZCMLLayer

Detailed Description

Definition at line 100 of file test_FSSTXMethod.py.


Member Function Documentation

Reimplemented from CMFCore.tests.test_FSSTXMethod._TemplateSwitcher.

Definition at line 104 of file test_FSSTXMethod.py.

00104 
00105     def setUp(self):
00106         _TemplateSwitcher.setUp(self)
00107         RequestTest.setUp(self)
00108         FSSTXMaker.setUp(self)

Reimplemented from CMFCore.tests.test_FSSTXMethod._TemplateSwitcher.

Definition at line 109 of file test_FSSTXMethod.py.

00109 
00110     def tearDown(self):
00111         FSSTXMaker.tearDown(self)
00112         RequestTest.tearDown(self)
00113         _TemplateSwitcher.tearDown(self)

Definition at line 153 of file test_FSSTXMethod.py.

00153 
00154     def test_304_response_from_cpm( self ):
00155         # test that we get a 304 response from the cpm via this template
00156         from DateTime import DateTime
00157         from webdav.common import rfc1123_date
00158         from Products.CMFCore.tests.base.dummy \
00159             import DummyCachingManagerWithPolicy
00160 
00161         mod_time = DateTime()
00162         self.root.caching_policy_manager = DummyCachingManagerWithPolicy()
00163         script = self._makeOne('testSTX', 'testSTX.stx')
00164         script = script.__of__(self.root)
00165         self.REQUEST.environ[ 'IF_MODIFIED_SINCE'
00166                             ] = '%s;' % rfc1123_date( mod_time+3600 )
00167         data = script(self.REQUEST, self.RESPONSE)
00168 
00169         self.assertEqual( data, '' )
00170         self.assertEqual( self.RESPONSE.getStatus(), 304 )
00171 

Here is the call graph for this function:

Definition at line 114 of file test_FSSTXMethod.py.

00114 
00115     def test___call___with_DTML( self ):
00116         self._setWhichTemplate('DTML')
00117         script = self._makeOne( 'testSTX', 'testSTX.stx' )
00118         script = script.__of__(self.app)
00119         self.assertEqual(_normalize_whitespace(script(self.REQUEST)),
00120                          _normalize_whitespace(_EXPECTED_HTML))

Here is the call graph for this function:

Definition at line 121 of file test_FSSTXMethod.py.

00121 
00122     def test___call___with_ZPT( self ):
00123         self._setWhichTemplate('ZPT')
00124         script = self._makeOne( 'testSTX', 'testSTX.stx' )
00125         script = script.__of__(self.app)
00126         self.assertEqual(_normalize_whitespace(script(self.REQUEST)),
00127                          _normalize_whitespace(_EXPECTED_HTML))

Here is the call graph for this function:

Definition at line 128 of file test_FSSTXMethod.py.

00128 
00129     def test_caching( self ):
00130         #   Test HTTP caching headers.
00131         from Products.CMFCore.tests.base.dummy import DummyCachingManager
00132         self._setWhichTemplate('DTML')
00133         self.root.caching_policy_manager = DummyCachingManager()
00134         original_len = len( self.RESPONSE.headers )
00135         script = self._makeOne('testSTX', 'testSTX.stx')
00136         script = script.__of__(self.root)
00137         script(self.REQUEST, self.RESPONSE)
00138         self.failUnless( len( self.RESPONSE.headers ) >= original_len + 2 )
00139         self.failUnless( 'foo' in self.RESPONSE.headers.keys() )
00140         self.failUnless( 'bar' in self.RESPONSE.headers.keys() )

Here is the call graph for this function:

Definition at line 141 of file test_FSSTXMethod.py.

00141 
00142     def test_ownership( self ):
00143         script = self._makeOne( 'testSTX', 'testSTX.stx' )
00144         script = script.__of__(self.root)
00145         # FSSTXMethod has no owner
00146         owner_tuple = script.getOwnerTuple()
00147         self.assertEqual(owner_tuple, None)
00148 
00149         # and ownership is not acquired [CMF/450]
00150         self.root._owner= ('/foobar', 'baz')
00151         owner_tuple = script.getOwnerTuple()
00152         self.assertEqual(owner_tuple, None)

Here is the call graph for this function:


Member Data Documentation

Definition at line 102 of file test_FSSTXMethod.py.


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