[Erp5-report] r39864 nicolas.dumazet - /erp5/trunk/products/ERP5Type/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 4 03:06:38 CET 2010


Author: nicolas.dumazet
Date: Thu Nov  4 03:06:37 2010
New Revision: 39864

URL: http://svn.erp5.org?rev=39864&view=rev
Log:
test showing that objects using BaseType/Folder/XMLObject documents are not migrated yet.

Modified:
    erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py

Modified: erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py?rev=39864&r1=39863&r2=39864&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/tests/testDynamicClassGeneration.py [utf8] Thu Nov  4 03:06:37 2010
@@ -41,7 +41,7 @@ class TestPortalTypeClass(ERP5TypeTestCa
 
   def testImportNonMigratedPerson(self):
     """
-    Import a .zexp containing a Person created with an old
+    Import a .xml containing a Person created with an old
     Products.ERP5Type.Document.Person.Person type
     """
     person_module = self.portal.person_module
@@ -50,8 +50,26 @@ class TestPortalTypeClass(ERP5TypeTestCa
 
     non_migrated_person = person_module.non_migrated_person
     # check that object unpickling instanciated a new style object
-    from erp5.portal_type import Person as erp5_document_person
-    self.assertEquals(non_migrated_person.__class__, erp5_document_person)
+    person_class = self.portal.portal_types.getPortalTypeClass('Person')
+    self.assertEquals(non_migrated_person.__class__, person_class)
+
+  @expectedFailure
+  def testImportNonMigratedDocumentUsingContentClass(self):
+    """
+    Import a .xml containing a Base Type with old Document path
+    Products.ERP5Type.ERP5Type.ERP5TypeInformation
+
+    This Document class is different because it's a content_class,
+    i.e. it was not in Products.ERP5Type.Document.** but was
+    imported directly as such.
+    """
+    self.importObjectFromFile(self.portal, 'Category.xml')
+    transaction.commit()
+
+    non_migrated_type = self.portal.Category
+    # check that object unpickling instanciated a new style object
+    base_type_class = self.portal.portal_types.getPortalTypeClass('Base Type')
+    self.assertEquals(non_migrated_type.__class__, base_type_class)
 
   def testMigrateOldObjectFromZODB(self):
     """




More information about the Erp5-report mailing list