[dependancy] do not use testlib from outside test: recent lgc versions recommends unittest2 while lgc.testlib needs it, and we don't want it to be necessary to run cw stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 21 Oct 2010 09:33:12 +0200
branchstable
changeset 6571 71b446d1cf93
parent 6562 34be5986bca0
child 6572 df0b2de62cec
[dependancy] do not use testlib from outside test: recent lgc versions recommends unittest2 while lgc.testlib needs it, and we don't want it to be necessary to run cw
server/migractions.py
--- a/server/migractions.py	Wed Oct 20 15:20:12 2010 +0200
+++ b/server/migractions.py	Thu Oct 21 09:33:12 2010 +0200
@@ -44,7 +44,6 @@
 
 from logilab.common.deprecation import deprecated
 from logilab.common.decorators import cached, clear_cache
-from logilab.common.testlib import mock_object
 
 from yams.constraints import SizeConstraint
 from yams.schema2sql import eschema2sql, rschema2sql
@@ -66,6 +65,10 @@
 except ImportError: # LAX
     pass
 
+
+def mock_object(**params):
+    return type('Mock', (), params)()
+
 class ClearGroupMap(hook.Hook):
     __regid__ = 'cw.migration.clear_group_mapping'
     __select__ = hook.Hook.__select__ & is_instance('CWGroup')