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

Yvo Schubbe schubbe@web.de
Wed, 25 Jun 2003 05:29:10 -0400


Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv15131/CMFCore/tests

Modified Files:
      Tag: yuppie-ti_aliases-branch
	test_TypesTool.py 
Log Message:
- improved migration and ui

=== CMF/CMFCore/tests/test_TypesTool.py 1.22.2.1 => 1.22.2.2 ===
--- CMF/CMFCore/tests/test_TypesTool.py:1.22.2.1	Tue Jun 24 15:08:37 2003
+++ CMF/CMFCore/tests/test_TypesTool.py	Wed Jun 25 05:28:39 2003
@@ -37,6 +37,7 @@
 from Products.CMFCore.tests.base.tidata import FTIDATA_ACTIONS
 from Products.CMFCore.tests.base.tidata import FTIDATA_CMF14
 from Products.CMFCore.tests.base.tidata import FTIDATA_CMF14_FOLDER
+from Products.CMFCore.tests.base.tidata import FTIDATA_CMF14_SPECIAL
 from Products.CMFCore.tests.base.tidata import FTIDATA_CMF15
 from Products.CMFCore.tests.base.tidata import FTIDATA_DUMMY
 from Products.CMFCore.tests.base.tidata import STI_SCRIPT
@@ -308,7 +309,7 @@
 
         # use old FTI Data
         ti = self._makeInstanceByFTIData(FTIDATA_CMF14)
-        self.assertEqual( ti._aliases, wanted )
+        self.assertEqual(ti._aliases, wanted)
 
         # simulate old FTI
         del ti._aliases
@@ -316,14 +317,14 @@
 
         # migrate FTI
         ti.getMethodPath('view')
-        self.assertEqual( ti._aliases, wanted )
+        self.assertEqual(ti._aliases, wanted)
 
     def test_MethodAliases_folder_migration(self):
         wanted = { 'view':('(Default)',), }
 
         # use old FTI Data
         ti = self._makeInstanceByFTIData(FTIDATA_CMF14_FOLDER)
-        self.assertEqual( ti._aliases, wanted )
+        self.assertEqual(ti._aliases, wanted)
 
         # simulate old FTI
         del ti._aliases
@@ -331,7 +332,22 @@
 
         # migrate FTI
         ti.getMethodPath('view')
-        self.assertEqual( ti._aliases, wanted )
+        self.assertEqual(ti._aliases, wanted)
+
+    def test_MethodAliases_special_migration(self):
+        wanted = { 'view':('dummy_view',), }
+
+        # use old FTI Data
+        ti = self._makeInstanceByFTIData(FTIDATA_CMF14_SPECIAL)
+        self.assertEqual(ti._aliases, wanted)
+
+        # simulate old FTI
+        del ti._aliases
+        self.failIf( hasattr(ti, '_aliases') )
+
+        # migrate FTI
+        ti.getMethodPath('view')
+        self.assertEqual(ti._aliases, wanted)
 
 
 class FTIDataTests( TypeInfoTests ):