cubicweb/test/unittest_cubes.py
changeset 11954 e0d708fb20e8
parent 11912 c9e6df20e5a4
child 11955 f85ec84355db
--- a/cubicweb/test/unittest_cubes.py	Mon Feb 06 15:43:19 2017 +0100
+++ b/cubicweb/test/unittest_cubes.py	Wed Feb 08 10:31:26 2017 +0100
@@ -93,6 +93,17 @@
             from cubes.foo import bar
             self.assertEqual(bar.baz, 1)
 
+    def test_reload_cube(self):
+        """reloading cubes twice should return the same module"""
+        CubicWebConfiguration.cls_adjust_sys_path()
+        import cubes
+        if PY2:
+            new = reload(cubes)
+        else:
+            import importlib
+            new = importlib.reload(cubes)
+        self.assertIs(new, cubes)
+
     def test_import_legacy_cube(self):
         """Check that importing a legacy cube works when sys.path got adjusted.
         """