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

Florent Guillaume fg at nuxeo.com
Wed May 18 16:23:02 EDT 2005


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

Modified Files:
      Tag: CMF-1_5-branch
	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.19.10.3 => 1.19.10.4 ===
--- Products/CMFCore/tests/test_DirectoryView.py:1.19.10.3	Wed Apr  6 05:53:39 2005
+++ Products/CMFCore/tests/test_DirectoryView.py	Wed May 18 16:23:01 2005
@@ -95,8 +95,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