[CMF-checkins] CVS: Products/CMFCore/tests - test_TypesTool.py:1.33

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Sep 7 04:49:08 EDT 2004


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

Modified Files:
	test_TypesTool.py 
Log Message:
Merged yuppie-ti_aliases-redo-branch:
- replaced getMethodPath and getMethodURL by queryMethodID


=== Products/CMFCore/tests/test_TypesTool.py 1.32 => 1.33 ===
--- Products/CMFCore/tests/test_TypesTool.py:1.32	Sun Aug  8 06:34:04 2004
+++ Products/CMFCore/tests/test_TypesTool.py	Tue Sep  7 04:48:38 2004
@@ -270,17 +270,14 @@
     def test_MethodAliases_methods(self):
         ti = self._makeInstance( **FTIDATA_CMF15[0] )
         self.assertEqual( ti.getMethodAliases(), FTIDATA_CMF15[0]['aliases'] )
-        self.assertEqual( ti.getMethodPath('view'), ('dummy_view',) )
-        self.assertEqual( ti.getMethodPath('view.html'), ('dummy_view',) )
-        self.assertEqual( ti.getMethodURL('view'), 'dummy_view' )
-        self.assertEqual( ti.getMethodURL('view.html'), 'dummy_view' )
+        self.assertEqual( ti.queryMethodID('view'), 'dummy_view' )
+        self.assertEqual( ti.queryMethodID('view.html'), 'dummy_view' )
 
         ti.setMethodAliases( ti.getMethodAliases() )
         self.assertEqual( ti.getMethodAliases(), FTIDATA_CMF15[0]['aliases'] )
 
     def _checkContentTI(self, ti):
-        wanted_aliases = { 'view':('dummy_view',),
-                           '(Default)':('dummy_view',) }
+        wanted_aliases = { 'view': 'dummy_view', '(Default)': 'dummy_view' }
         wanted_actions_text0 = 'string:${object_url}/dummy_view'
         wanted_actions_text1 = 'string:${object_url}/dummy_edit_form'
         wanted_actions_text2 = 'string:${object_url}/metadata_edit_form'
@@ -302,7 +299,7 @@
         self.assertEqual( action0.getVisibility(), 1 )
 
     def _checkFolderTI(self, ti):
-        wanted_aliases = { 'view':('(Default)',), }
+        wanted_aliases = { 'view': '(Default)' }
         wanted_actions_text0 = 'string:${object_url}'
         wanted_actions_text1 = 'string:${object_url}/dummy_edit_form'
         wanted_actions_text2 = 'string:${object_url}/folder_localrole_form'
@@ -327,7 +324,7 @@
         self.failUnless( isinstance(ti._actions[0], dict) )
 
         # migrate FTI
-        ti.getMethodPath('view')
+        ti.queryMethodID('view')
         self._checkContentTI(ti)
 
     def test_CMF13_folder_migration(self):
@@ -343,7 +340,7 @@
         self.failUnless( isinstance(ti._actions[0], dict) )
 
         # migrate FTI
-        ti.getMethodPath('view')
+        ti.queryMethodID('view')
         self._checkFolderTI(ti)
 
     def test_CMF14_content_migration(self):
@@ -357,7 +354,7 @@
         self.failIf( hasattr(ti, '_aliases') )
 
         # migrate FTI
-        ti.getMethodPath('view')
+        ti.queryMethodID('view')
         self._checkContentTI(ti)
 
     def test_CMF14_folder_migration(self):
@@ -371,11 +368,11 @@
         self.failIf( hasattr(ti, '_aliases') )
 
         # migrate FTI
-        ti.getMethodPath('view')
+        ti.queryMethodID('view')
         self._checkFolderTI(ti)
 
     def test_CMF14_special_migration(self):
-        wanted = { 'view':('dummy_view',), 'mkdir':('dummy_mkdir',) }
+        wanted = { 'view': 'dummy_view', 'mkdir': 'dummy_mkdir' }
 
         # use old FTI Data
         ti = self._makeInstance( **FTIDATA_CMF14_SPECIAL[0] )
@@ -386,7 +383,7 @@
         self.failIf( hasattr(ti, '_aliases') )
 
         # migrate FTI
-        ti.getMethodPath('view')
+        ti.queryMethodID('view')
         self.assertEqual(ti._aliases, wanted)
 
     def test_CMF14_special2_migration(self):
@@ -401,8 +398,22 @@
         self.failIf( hasattr(ti, '_aliases') )
 
         # migrate FTI
-        ti.getMethodPath('view')
+        ti.queryMethodID('view')
         self.assertEqual(ti._aliases, wanted)
+
+    def test_CMF150beta_content_migration(self):
+
+        # use old FTI Data
+        ti = self._makeInstance( **FTIDATA_CMF14[0] )
+        self._checkContentTI(ti)
+
+        # simulate old FTI
+        ti._aliases = { 'view': ('dummy_view',),
+                        '(Default)': ('dummy_view',) }
+
+        # migrate FTI
+        ti.getMethodAliases()
+        self._checkContentTI(ti)
 
 
 class FTIDataTests( TypeInfoTests ):



More information about the CMF-checkins mailing list