[CMF-checkins] CVS: Products/CMFCore/tests - test_DirectoryView.py:1.25

Florent Guillaume fg at nuxeo.com
Wed May 18 16:33:46 EDT 2005


Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv24145/CMFCore/tests

Modified Files:
	test_DirectoryView.py 
Log Message:
Do not cause ZODB writes or ConflictError if an old DirectoryView with a
non-existing path is left. Sends a warning to stderr about those.
(http://www.zope.org/Collectors/CMF/347)


=== Products/CMFCore/tests/test_DirectoryView.py 1.24 => 1.25 ===
--- Products/CMFCore/tests/test_DirectoryView.py:1.24	Wed Apr  6 05:54:45 2005
+++ Products/CMFCore/tests/test_DirectoryView.py	Wed May 18 16:33:46 2005
@@ -105,8 +105,14 @@
     # Test we do nothing if given a really wacky path
     def test_UnhandleableExpandPath( self ):
         from tempfile import mktemp
-        self.ob.fake_skin.manage_properties(mktemp())
+        file = mktemp()
+        self.ob.fake_skin.manage_properties(file)
         self.assertEqual(self.ob.fake_skin.objectIds(),[])
+        # Check that a warning was raised.
+        from Products.CMFCore import DirectoryView
+        warnings = [t[0] for t in DirectoryView.__warningregistry__]
+        text = 'DirectoryView fake_skin refers to a non-existing path %s' % file
+        self.assert_(text in warnings)
 
     def test_UnhandleableMinimalPath( self ):
         from Products.CMFCore.utils import minimalpath, normalize



More information about the CMF-checkins mailing list