[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Folder/tests - testFolderAdder.py:1.1.2.7 testFolderContents.py:1.1.2.2

Paul Everitt paul@zope.com
Thu, 28 Feb 2002 18:26:58 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Folder/tests
In directory cvs.zope.org:/tmp/cvs-serv5207/tests

Modified Files:
      Tag: Zope-3x-branch
	testFolderAdder.py testFolderContents.py 
Log Message:
Changed folder attr to use addable instances in the page template.  

Added some missing security assertions.

Added links and method in folder contents to create or navigate to 
a service manager.



=== Zope3/lib/python/Zope/App/OFS/Folder/tests/testFolderAdder.py 1.1.2.6 => 1.1.2.7 ===
         self.assertEquals( len( info_list ), len( data ) )
 
-        id_list = map( lambda x: x['id'], info_list )
+        id_list = map( lambda x: x.id(), info_list )
         self.assert_( 'foo' in id_list )
         self.assert_( 'bar' in id_list )
         self.assert_( 'baz' in id_list )
 
-        title_list = map( lambda x: x['title'], info_list )
+        title_list = map( lambda x: x.title(), info_list )
         self.assert_( 'Foo' in title_list )
         self.assert_( 'Bar' in title_list )
         self.assert_( 'Baz' in title_list )


=== Zope3/lib/python/Zope/App/OFS/Folder/tests/testFolderContents.py 1.1.2.1 => 1.1.2.2 ===
         fc.remove( 'document3', 1 )
 
+    def testAddServiceManager(self):
+        folder = Folder()
+        fc = FolderContents(folder)
+        fc.addServiceManager()
+        self.failUnless(folder.hasServiceManager())
+        self.assertRaises('HasServiceManager', fc.addServiceManager)
+
 def test_suite():
     loader = unittest.TestLoader()
     return loader.loadTestsFromTestCase( Test )