Commit 733c35fc authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Arnaud Fontaine

fixup! XXX all changes to test (product)

parent 17cf1c5a
Pipeline #35975 failed with stage
...@@ -1454,7 +1454,7 @@ class TestZodbModuleComponent(SecurityTestCase): ...@@ -1454,7 +1454,7 @@ class TestZodbModuleComponent(SecurityTestCase):
def afterSetUp(self): def afterSetUp(self):
self._component_tool = self.portal.portal_components self._component_tool = self.portal.portal_components
self._module = __import__(self._document_class._getDynamicModuleNamespace(), self._module = __import__(self._document_class._getDynamicModuleNamespace(),
fromlist=['erp5.component'] if six.PY2 else ['erp5']) fromlist=[''])
self._component_tool.reset(force=True, self._component_tool.reset(force=True,
reset_portal_type_at_transaction_boundary=True) reset_portal_type_at_transaction_boundary=True)
...@@ -1524,10 +1524,7 @@ class TestZodbModuleComponent(SecurityTestCase): ...@@ -1524,10 +1524,7 @@ class TestZodbModuleComponent(SecurityTestCase):
if expected_default_version is not None: if expected_default_version is not None:
top_module_name = self._document_class._getDynamicModuleNamespace() top_module_name = self._document_class._getDynamicModuleNamespace()
top_module = __import__( top_module = __import__(top_module_name, level=0, fromlist=[''])
top_module_name,
level=0,
fromlist=[top_module_name] if six.PY2 else ['erp5'])
# The module must be available in its default version # The module must be available in its default version
self.assertHasAttribute(top_module, expected_default_version) self.assertHasAttribute(top_module, expected_default_version)
...@@ -1558,8 +1555,7 @@ class TestZodbModuleComponent(SecurityTestCase): ...@@ -1558,8 +1555,7 @@ class TestZodbModuleComponent(SecurityTestCase):
module_name = self._getComponentFullModuleName(module_name) module_name = self._getComponentFullModuleName(module_name)
module = __import__( module = __import__(
module_name, module_name,
fromlist=[self._document_class._getDynamicModuleNamespace()] fromlist=[''],
if six.PY2 else ['erp5'],
level=0) level=0)
self.assertIn(module_name, sys.modules) self.assertIn(module_name, sys.modules)
return module return module
...@@ -2052,7 +2048,7 @@ def bar(*args, **kwargs): ...@@ -2052,7 +2048,7 @@ def bar(*args, **kwargs):
self.assertModuleImportable('erp5_version.%s' % imported_reference) self.assertModuleImportable('erp5_version.%s' % imported_reference)
top_module = __import__(top_module_name, level=0, top_module = __import__(top_module_name, level=0,
fromlist=[top_module_name] if six.PY2 else ['erp5']) fromlist=[''])
self._importModule('erp5_version.%s' % imported_reference) self._importModule('erp5_version.%s' % imported_reference)
...@@ -2115,7 +2111,7 @@ def function_foo(*args, **kwargs): ...@@ -2115,7 +2111,7 @@ def function_foo(*args, **kwargs):
top_module_name = self._document_class._getDynamicModuleNamespace() top_module_name = self._document_class._getDynamicModuleNamespace()
top_module = __import__(top_module_name, level=0, top_module = __import__(top_module_name, level=0,
fromlist=[top_module_name] if six.PY2 else ['erp5']) fromlist=[''])
self._importModule(reference) self._importModule(reference)
module = getattr(top_module, reference) module = getattr(top_module, reference)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment