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

Jens Vagelpohl jens at dataflake.org
Fri Mar 25 07:53:51 EST 2005


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

Modified Files:
      Tag: CMF-1_5-branch
	test_TypesTool.py 
Log Message:
- CMFCore.TypesTool: Added backwards compatibility code to the fix for
  collector issue 49 (http://collector.zope.org/CMF/49)


=== Products/CMFCore/tests/test_TypesTool.py 1.32.2.3 => 1.32.2.4 ===
--- Products/CMFCore/tests/test_TypesTool.py:1.32.2.3	Mon Nov 22 13:38:58 2004
+++ Products/CMFCore/tests/test_TypesTool.py	Fri Mar 25 07:53:51 2005
@@ -133,6 +133,23 @@
         dropdown_representation = [x[0] for x in types]
         self.failIf(dropdown_representation[0]==dropdown_representation[1])
 
+        # Backwards-compatibility tests
+        # Make sure the old representation still works, for now
+        ti_factory = self.ttool.manage_addTypeInformation
+        ti_type = 'Factory-based Type Information'
+        new_repr = 'product1: Dummy Content (Dummy)'
+        old_repr = 'product1: Dummy'
+
+        # This one uses the new representation. We do not expect an Exception
+        ti_factory(ti_type, id='NewType1', typeinfo_name=new_repr)
+        self.failUnless('NewType1' in self.ttool.objectIds())
+
+        # Now try with the old representation, which will throw a BadRequest
+        # unless the workaround in the code is used
+        ti_factory(ti_type, id='NewType2', typeinfo_name=old_repr)
+        self.failUnless('NewType2' in self.ttool.objectIds())
+
+
     def test_constructContent(self):
         site = self.site
         acl_users = self.acl_users



More information about the CMF-checkins mailing list