Commit b3c79a51 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Cosmetic.

parent fcf1d15c
...@@ -1242,9 +1242,7 @@ class _TestZodbComponent(SecurityTestCase): ...@@ -1242,9 +1242,7 @@ class _TestZodbComponent(SecurityTestCase):
elif 'ERP5TypeTestCase' not in product_config['erp5'].developer_list: elif 'ERP5TypeTestCase' not in product_config['erp5'].developer_list:
product_config['erp5'].developer_list.append('ERP5TypeTestCase') product_config['erp5'].developer_list.append('ERP5TypeTestCase')
self._component_tool = self.getPortal().portal_components
self._portal = self.getPortal()
self._component_tool = self._portal.portal_components
self._module = __import__(self._getComponentModuleName(), self._module = __import__(self._getComponentModuleName(),
fromlist=['erp5.component']) fromlist=['erp5.component'])
self._component_tool.reset() self._component_tool.reset()
...@@ -1680,7 +1678,7 @@ class TestZodbExtensionComponent(_TestZodbComponent): ...@@ -1680,7 +1678,7 @@ class TestZodbExtensionComponent(_TestZodbComponent):
# Add an External Method using the Extension Component defined above and # Add an External Method using the Extension Component defined above and
# check that it returns 42 # check that it returns 42
from Products.ExternalMethod.ExternalMethod import manage_addExternalMethod from Products.ExternalMethod.ExternalMethod import manage_addExternalMethod
manage_addExternalMethod(self._portal, manage_addExternalMethod(self.getPortal(),
'TestExternalMethod', 'TestExternalMethod',
'title', 'title',
'TestExternalMethodComponent', 'TestExternalMethodComponent',
...@@ -1689,18 +1687,18 @@ class TestZodbExtensionComponent(_TestZodbComponent): ...@@ -1689,18 +1687,18 @@ class TestZodbExtensionComponent(_TestZodbComponent):
transaction.commit() transaction.commit()
self.tic() self.tic()
external_method = self._portal.TestExternalMethod external_method = self.getPortal().TestExternalMethod
self.assertEqual(external_method(), 42) self.assertEqual(external_method(), 42)
# Add a Python Script with the External Method defined above and check # Add a Python Script with the External Method defined above and check
# that it returns 42 # that it returns 42
from Products.PythonScripts.PythonScript import manage_addPythonScript from Products.PythonScripts.PythonScript import manage_addPythonScript
manage_addPythonScript(self._portal, 'TestPythonScript') manage_addPythonScript(self.getPortal(), 'TestPythonScript')
self._portal.TestPythonScript.write('return context.TestExternalMethod()') self.getPortal().TestPythonScript.write('return context.TestExternalMethod()')
transaction.commit() transaction.commit()
self.tic() self.tic()
self.assertEqual(self._portal.TestPythonScript(), 42) self.assertEqual(self.getPortal().TestPythonScript(), 42)
# Invalidate the Extension Component # Invalidate the Extension Component
test_component.invalidate() test_component.invalidate()
...@@ -1758,12 +1756,12 @@ class TestPortalType(Person): ...@@ -1758,12 +1756,12 @@ class TestPortalType(Person):
# be available # be available
self.assertModuleImportable('TestPortalType') self.assertModuleImportable('TestPortalType')
person_type = self._portal.portal_types.Person person_type = self.getPortal().portal_types.Person
person_type_class = person_type.getTypeClass() person_type_class = person_type.getTypeClass()
self.assertEquals(person_type_class, 'Person') self.assertEquals(person_type_class, 'Person')
# Create a new Person # Create a new Person
person_module = self._portal.person_module person_module = self.getPortal().person_module
person = person_module.newContent(id='Foo Bar', portal_type='Person') person = person_module.newContent(id='Foo Bar', portal_type='Person')
self.assertTrue(PersonDocument in person.__class__.mro()) self.assertTrue(PersonDocument in person.__class__.mro())
......
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