From 39c6af78cf5b62df86dd0664cfafa9a394678564 Mon Sep 17 00:00:00 2001
From: Nicolas Dumazet <nicolas.dumazet@nexedi.com>
Date: Thu, 4 Nov 2010 02:06:37 +0000
Subject: [PATCH] test showing that objects using BaseType/Folder/XMLObject
 documents are not migrated yet.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39864 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../tests/testDynamicClassGeneration.py       | 24 ++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Type/tests/testDynamicClassGeneration.py b/product/ERP5Type/tests/testDynamicClassGeneration.py
index 7f42dd4607e..d6c98dea9be 100644
--- a/product/ERP5Type/tests/testDynamicClassGeneration.py
+++ b/product/ERP5Type/tests/testDynamicClassGeneration.py
@@ -41,7 +41,7 @@ class TestPortalTypeClass(ERP5TypeTestCase):
 
   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(ERP5TypeTestCase):
 
     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):
     """
-- 
2.30.9