[Erp5-report] r30232 - /erp5/trunk/products/CMFActivity/tests/testCMFActivity.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Nov 2 20:12:41 CET 2009


Author: leonardo
Date: Mon Nov  2 20:12:40 2009
New Revision: 30232

URL: http://svn.erp5.org?rev=30232&view=rev
Log:
delay importing dynamically generated module until after Product initialization (approved by jm)

Modified:
    erp5/trunk/products/CMFActivity/tests/testCMFActivity.py

Modified: erp5/trunk/products/CMFActivity/tests/testCMFActivity.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/tests/testCMFActivity.py?rev=30232&r1=30231&r2=30232&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/tests/testCMFActivity.py [utf8] (original)
+++ erp5/trunk/products/CMFActivity/tests/testCMFActivity.py [utf8] Mon Nov  2 20:12:40 2009
@@ -35,7 +35,10 @@
                                               VALIDATE_ERROR_STATE
 from Products.CMFActivity.Activity.Queue import VALIDATION_ERROR_DELAY
 from Products.CMFActivity.Errors import ActivityPendingError, ActivityFlushError
-from Products.ERP5Type.Document.Organisation import Organisation
+# This cannot be imported at top level because it doesn't exist until
+# Products.ERP5 has been initialized. We set it up as global and 
+#from Products.ERP5Type.Document.Organisation import Organisation
+Organisation = None
 from AccessControl.SecurityManagement import newSecurityManager
 from zLOG import LOG
 from ZODB.POSException import ConflictError
@@ -101,7 +104,11 @@
       o1 = organisation_module.newContent(id=self.company_id)
     get_transaction().commit()
     self.tic()
-
+    # import it now that Products.ERP5 has been initialized
+    global Organisation
+    from Products.ERP5Type.Document.Organisation import Organisation as Org
+    Organisation = Org
+    
 
   def login(self, quiet=0, run=run_all_test):
     uf = self.getPortal().acl_users




More information about the Erp5-report mailing list