[i18n test] hack to make i18n tests run using a Python interpreter stable
authorDavid Douard <david.douard@logilab.fr>
Tue, 30 Jul 2013 16:48:57 +0200
branchstable
changeset 9202 83f73a9746f6
parent 9201 b0f6e8c14e7f
child 9203 c7ba8e5d2e45
[i18n test] hack to make i18n tests run using a Python interpreter they used to work fine when executed via pytest only. This should be removed as soon as logilab.common.registry is fixed.
devtools/test/data/cubes/i18ntestcube/views.py
devtools/test/unittest_i18n.py
--- a/devtools/test/data/cubes/i18ntestcube/views.py	Tue Jul 30 10:06:06 2013 +0200
+++ b/devtools/test/data/cubes/i18ntestcube/views.py	Tue Jul 30 16:48:57 2013 +0200
@@ -25,7 +25,10 @@
     __select__ = is_instance('ForumThread')
 
 _myafs = MyAFS()
+
+# XXX useless ASA logilab.common.registry is fixed
 _myafs.__module__ = "cubes.i18ntestcube.views"
+
 _myafs.tag_object_of(('*', 'in_forum', 'Forum'), 'main', 'inlined')
 
 afs.tag_object_of(('*', 'in_forum', 'Forum'), 'main', 'inlined')
--- a/devtools/test/unittest_i18n.py	Tue Jul 30 10:06:06 2013 +0200
+++ b/devtools/test/unittest_i18n.py	Tue Jul 30 16:48:57 2013 +0200
@@ -71,4 +71,9 @@
         self.assertEqual(msgs, newmsgs)
 
 if __name__ == '__main__':
+    # XXX dirty hack to make this test runnable using python (works
+    # fine with pytest, but not with python directly if this hack is
+    # not present)
+    # XXX to remove ASA logilab.common is fixed
+    sys.path.append('')
     unittest_main()