Back to index

plone3  3.1.7
Public Member Functions
CMFCore.tests.test_DirectoryView.DirectoryViewTests Class Reference
Inheritance diagram for CMFCore.tests.test_DirectoryView.DirectoryViewTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_DirectoryView.DirectoryViewTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_addDirectoryViews
def test_DirectoryViewExists
def test_DirectoryViewMethod
def test_properties
def test_ignored
def test_surrogate_writethrough

Detailed Description

Definition at line 170 of file test_DirectoryView.py.


Member Function Documentation

Definition at line 172 of file test_DirectoryView.py.

00172 
00173     def setUp( self ):
00174         FSDVTest.setUp(self)
00175         self._registerDirectory(self)

Here is the call graph for this function:

Definition at line 176 of file test_DirectoryView.py.

00176 
00177     def test_addDirectoryViews( self ):
00178         # Test addDirectoryViews
00179         # also test registration of directory views doesn't barf
00180         pass

Definition at line 181 of file test_DirectoryView.py.

00181 
00182     def test_DirectoryViewExists( self ):
00183         # Check DirectoryView added by addDirectoryViews
00184         # appears as a DirectoryViewSurrogate due
00185         # to Acquisition hackery.
00186         from Products.CMFCore.DirectoryView import DirectoryViewSurrogate
00187         self.failUnless(isinstance(self.ob.fake_skin,DirectoryViewSurrogate))

Definition at line 188 of file test_DirectoryView.py.

00188 
00189     def test_DirectoryViewMethod( self ):
00190         # Check if DirectoryView method works
00191         self.assertEqual(self.ob.fake_skin.test1(),'test1')

Definition at line 196 of file test_DirectoryView.py.

00196 
00197     def test_ignored(self):
00198         # Test that "artifact" files and dirs are ignored
00199         for name in '#test1', 'CVS', '.test1', 'test1~':
00200             assert(name not in self.ob.fake_skin.objectIds(),
00201                    '%s not ignored' % name)

Definition at line 192 of file test_DirectoryView.py.

00192 
00193     def test_properties(self):
00194         # Make sure the directory view is reading properties
00195         self.assertEqual(self.ob.fake_skin.testPT.title, 'Zope Pope')

Definition at line 202 of file test_DirectoryView.py.

00202 
00203     def test_surrogate_writethrough(self):
00204         # CMF Collector 316: It is possible to cause ZODB writes because
00205         # setting attributes on the non-persistent surrogate writes them
00206         # into the persistent DirectoryView as well. This is bad in situations
00207         # where you only want to store markers and remove them before the
00208         # transaction has ended - they never got removed because there was
00209         # no equivalent __delattr__ on the surrogate that would clean up
00210         # the persistent DirectoryView as well.
00211         fs = self.ob.fake_skin
00212         test_foo = 'My Foovalue'
00213         fs.foo = test_foo
00214 
00215         self.assertEqual(fs.foo, test_foo)
00216         self.assertEqual(fs.__dict__['_real'].foo, test_foo)
00217 
00218         del fs.foo
00219 
00220         self.assertRaises(AttributeError, getattr, fs, 'foo')
00221         self.assertRaises( AttributeError
00222                          , getattr
00223                          , fs.__dict__['_real']
00224                          , 'foo'
00225                          )
00226 


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