Commit 14f26ca0 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Fix descendants of PropertySheetTestCase:

* use beforeTearDown instead of tearDown
* pay attention to abort() ordering so that no parent or
  subclass calls can invalidate necessary changes from tearDown logic
* use unique names for property sheets to get independant fixtures.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43099 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 59359459
...@@ -58,10 +58,10 @@ class TestPreferences(PropertySheetTestCase): ...@@ -58,10 +58,10 @@ class TestPreferences(PropertySheetTestCase):
self.createPreferences() self.createPreferences()
def beforeTearDown(self): def beforeTearDown(self):
transaction.abort()
portal_preferences = self.getPreferenceTool() portal_preferences = self.getPreferenceTool()
portal_preferences.manage_delObjects(list(portal_preferences.objectIds())) portal_preferences.manage_delObjects(list(portal_preferences.objectIds()))
transaction.commit() super(TestPreferences, self).beforeTearDown()
self.tic()
def createPreferences(self): def createPreferences(self):
""" create some preferences objects """ """ create some preferences objects """
...@@ -560,7 +560,8 @@ class TestPreferences(PropertySheetTestCase): ...@@ -560,7 +560,8 @@ class TestPreferences(PropertySheetTestCase):
self.assertEqual(system_pref, preference_tool.getActiveSystemPreference()) self.assertEqual(system_pref, preference_tool.getActiveSystemPreference())
def test_boolean_accessor(self): def test_boolean_accessor(self):
self._addProperty('Preference', 'DummyPreference', self._addProperty('Preference',
'test_boolean_accessor Preference',
portal_type='Standard Property', portal_type='Standard Property',
property_id='dummy', property_id='dummy',
preference=True, preference=True,
...@@ -584,7 +585,8 @@ class TestPreferences(PropertySheetTestCase): ...@@ -584,7 +585,8 @@ class TestPreferences(PropertySheetTestCase):
write_permission = 'Modify portal content' write_permission = 'Modify portal content'
read_permission = 'Manage portal' read_permission = 'Manage portal'
self._addProperty('Preference', 'DummyPreference', self._addProperty('Preference',
'test_property_sheet_security_on_permission Preference',
property_id='preferred_toto', property_id='preferred_toto',
portal_type='Standard Property', portal_type='Standard Property',
preference=1, preference=1,
...@@ -633,7 +635,8 @@ class TestPreferences(PropertySheetTestCase): ...@@ -633,7 +635,8 @@ class TestPreferences(PropertySheetTestCase):
default_preference_string = 'Default Name' default_preference_string = 'Default Name'
normal_preference_string = 'Normal Preference' normal_preference_string = 'Normal Preference'
system_preference_string = 'System Preference' system_preference_string = 'System Preference'
self._addProperty('Preference', 'DummySystemPreference', self._addProperty('Preference',
'test_system_preference_value_prefererred Preference',
portal_type='Standard Property', portal_type='Standard Property',
property_id='dummystring', property_id='dummystring',
property_default='python: "%s"' % default_preference_string, property_default='python: "%s"' % default_preference_string,
...@@ -667,7 +670,8 @@ class TestPreferences(PropertySheetTestCase): ...@@ -667,7 +670,8 @@ class TestPreferences(PropertySheetTestCase):
default_preference_string = 'Default Name' default_preference_string = 'Default Name'
normal_preference_string = 'Normal Preference' normal_preference_string = 'Normal Preference'
system_preference_string = 'System Preference' system_preference_string = 'System Preference'
self._addProperty('Preference', 'DummySystemPreference', self._addProperty('Preference',
'test_system_preference_value_prefererred_clear_cache_disabled Preference',
portal_type='Standard Property', portal_type='Standard Property',
property_id='dummystring', property_id='dummystring',
property_default='python: "%s"' % default_preference_string, property_default='python: "%s"' % default_preference_string,
......
...@@ -72,8 +72,7 @@ class TestConstraint(PropertySheetTestCase): ...@@ -72,8 +72,7 @@ class TestConstraint(PropertySheetTestCase):
transaction.abort() transaction.abort()
module = self.portal.organisation_module module = self.portal.organisation_module
module.manage_delObjects(list(module.objectIds())) module.manage_delObjects(list(module.objectIds()))
transaction.commit() super(TestConstraint, self).beforeTearDown()
self.tic()
def createCategories(self): def createCategories(self):
""" """
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
import cPickle import cPickle
import md5
import unittest import unittest
import sys import sys
...@@ -42,7 +41,6 @@ from Products.ERP5Type.tests.utils import LogInterceptor ...@@ -42,7 +41,6 @@ from Products.ERP5Type.tests.utils import LogInterceptor
from Products.CMFCore.WorkflowCore import WorkflowException from Products.CMFCore.WorkflowCore import WorkflowException
from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter from Products.ERP5Type.Accessor.Constant import PropertyGetter as ConstantGetter
from Products.ERP5Type.tests.utils import installRealClassTool from Products.ERP5Type.tests.utils import installRealClassTool
from Products.ERP5Type.Utils import removeLocalPropertySheet
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from AccessControl import Unauthorized from AccessControl import Unauthorized
...@@ -64,9 +62,8 @@ class PropertySheetTestCase(ERP5TypeTestCase): ...@@ -64,9 +62,8 @@ class PropertySheetTestCase(ERP5TypeTestCase):
super(PropertySheetTestCase,self).setUp() super(PropertySheetTestCase,self).setUp()
installRealClassTool(self.getPortal()) installRealClassTool(self.getPortal())
def tearDown(self): def beforeTearDown(self):
"""Clean up """ """Clean up """
transaction.abort()
ttool = self.getTypesTool() ttool = self.getTypesTool()
# remove all property sheet we added to type informations # remove all property sheet we added to type informations
for ti_name, psheet_list in self._added_property_sheets.items(): for ti_name, psheet_list in self._added_property_sheets.items():
...@@ -81,7 +78,8 @@ class PropertySheetTestCase(ERP5TypeTestCase): ...@@ -81,7 +78,8 @@ class PropertySheetTestCase(ERP5TypeTestCase):
# but in the other hand, if isolates the test "just in case" # but in the other hand, if isolates the test "just in case"
ttool.resetDynamicDocumentsOnceAtTransactionBoundary() ttool.resetDynamicDocumentsOnceAtTransactionBoundary()
transaction.commit() transaction.commit()
super(PropertySheetTestCase, self).tearDown() self.tic()
super(PropertySheetTestCase, self).beforeTearDown()
def _addProperty(self, portal_type_name, property_sheet_id, def _addProperty(self, portal_type_name, property_sheet_id,
property_id=None, property_id=None,
...@@ -145,8 +143,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -145,8 +143,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self.getTypesTool().getTypeInfo('Person').acquire_local_roles = self.person_acquire_local_roles self.getTypesTool().getTypeInfo('Person').acquire_local_roles = self.person_acquire_local_roles
self.portal.portal_caches.clearAllCache() self.portal.portal_caches.clearAllCache()
transaction.commit() super(TestERP5Type, self).beforeTearDown()
self.tic()
def loginWithNoRole(self): def loginWithNoRole(self):
uf = self.portal.acl_users uf = self.portal.acl_users
...@@ -828,7 +825,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -828,7 +825,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
"""Tests that the default value is returned correctly when a default """Tests that the default value is returned correctly when a default
value is defined using the property sheet. value is defined using the property sheet.
""" """
self._addProperty('Person', 'Person_dummy_ps_prop', 'dummy_ps_prop', self._addProperty('Person',
'test_15b_DefaultValueDefinedOnPropertySheet',
'dummy_ps_prop',
elementary_type='string', elementary_type='string',
portal_type='Standard Property', portal_type='Standard Property',
property_default='python: "ps_default"') property_default='python: "ps_default"')
...@@ -860,7 +859,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -860,7 +859,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
"""Tests that the default value is returned correctly when a default """Tests that the default value is returned correctly when a default
value is defined using the property sheet, on list accesors. value is defined using the property sheet, on list accesors.
""" """
self._addProperty('Person', 'Person_dummy_ps_prop', 'dummy_ps_prop', self._addProperty('Person',
'test_15b_ListAccessorsDefaultValueDefinedOnPropertySheet',
'dummy_ps_prop',
elementary_type='lines', elementary_type='lines',
portal_type='Standard Property', portal_type='Standard Property',
property_default='python: [1,2,3]') property_default='python: [1,2,3]')
...@@ -905,7 +906,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -905,7 +906,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
def test_16_SimpleStringAccessor(self): def test_16_SimpleStringAccessor(self):
"""Tests a simple string accessor. """Tests a simple string accessor.
This is also a way to test _addProperty method """ This is also a way to test _addProperty method """
self._addProperty('Person', 'Person_dummy_ps_prop', 'dummy_ps_prop', self._addProperty('Person',
'test_16_SimpleStringAccessor',
'dummy_ps_prop',
elementary_type='string', elementary_type='string',
portal_type='Standard Property') portal_type='Standard Property')
person = self.getPersonModule().newContent(id='1', portal_type='Person') person = self.getPersonModule().newContent(id='1', portal_type='Person')
...@@ -1008,7 +1011,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1008,7 +1011,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# For testing purposes, we add a default_organisation inside a person, # For testing purposes, we add a default_organisation inside a person,
# and we add code to generate a 'default_organisation_title' property on # and we add code to generate a 'default_organisation_title' property on
# this person that will returns the organisation title. # this person that will returns the organisation title.
self._addProperty('Person', 'Person_organisation', 'organisation', self._addProperty('Person',
'test_18_SimpleContentAccessor',
'organisation',
**self.DEFAULT_ORGANISATION_TITLE_PROP) **self.DEFAULT_ORGANISATION_TITLE_PROP)
person = self.getPersonModule().newContent(id='1', portal_type='Person') person = self.getPersonModule().newContent(id='1', portal_type='Person')
self.assertTrue(hasattr(person, 'getDefaultOrganisationTitle')) self.assertTrue(hasattr(person, 'getDefaultOrganisationTitle'))
...@@ -1070,7 +1075,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1070,7 +1075,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# This is test is very similar to test_18_SimpleContentAccessor, but we # This is test is very similar to test_18_SimpleContentAccessor, but we
# use reference instead of title, because Reference accessors are # use reference instead of title, because Reference accessors are
# generated. # generated.
self._addProperty('Person', 'Person_organisation', 'organisation', self._addProperty('Person',
'test_18_SimpleContentAccessorWithGeneratedAccessor',
'organisation',
**self.DEFAULT_ORGANISATION_TITLE_PROP) **self.DEFAULT_ORGANISATION_TITLE_PROP)
person = self.getPersonModule().newContent(id='1', portal_type='Person') person = self.getPersonModule().newContent(id='1', portal_type='Person')
self.assertTrue(hasattr(person, 'getDefaultOrganisationReference')) self.assertTrue(hasattr(person, 'getDefaultOrganisationReference'))
...@@ -1128,7 +1135,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1128,7 +1135,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
that may have the same id, using same scenario as test_18 that may have the same id, using same scenario as test_18
Note that we only test Setter for now. Note that we only test Setter for now.
""" """
self._addProperty('Person', 'Person_organisation', 'organisation', self._addProperty('Person',
'test_18b_ContentAccessorWithIdClash',
'organisation',
**self.DEFAULT_ORGANISATION_TITLE_PROP) **self.DEFAULT_ORGANISATION_TITLE_PROP)
person = self.getPersonModule().newContent(id='1', portal_type='Person') person = self.getPersonModule().newContent(id='1', portal_type='Person')
another_person = self.getPersonModule().newContent( another_person = self.getPersonModule().newContent(
...@@ -1170,7 +1179,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1170,7 +1179,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
# defined, then we will acquire the default organisation title of the # defined, then we will acquire the default organisation title of the
# `destination` person. This is a stupid example, but it works with # `destination` person. This is a stupid example, but it works with
# objects we have in our testing environnement # objects we have in our testing environnement
self._addProperty('Person', 'Person_organisation', 'organisation', self._addProperty('Person',
'test_19_AcquiredContentAccessor',
'organisation',
**self.DEFAULT_ORGANISATION_TITLE_ACQUIRED_PROP) **self.DEFAULT_ORGANISATION_TITLE_ACQUIRED_PROP)
# add destination base category to Person TI # add destination base category to Person TI
person_ti = self.getTypesTool().getTypeInfo('Person') person_ti = self.getTypesTool().getTypeInfo('Person')
...@@ -1202,7 +1213,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1202,7 +1213,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
that may have the same id, using same scenario as test_19 that may have the same id, using same scenario as test_19
Note that we only test Setter for now. Note that we only test Setter for now.
""" """
self._addProperty('Person', 'Person_organisation', 'organisation', self._addProperty('Person',
'test_19b_AcquiredContentAccessorWithIdClash',
'organisation',
**self.DEFAULT_ORGANISATION_TITLE_ACQUIRED_PROP) **self.DEFAULT_ORGANISATION_TITLE_ACQUIRED_PROP)
# add destination base category to Person TI # add destination base category to Person TI
person_ti = self.getTypesTool().getTypeInfo('Person') person_ti = self.getTypesTool().getTypeInfo('Person')
...@@ -1245,10 +1258,14 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1245,10 +1258,14 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
We check in particular that getDefault[Property] and We check in particular that getDefault[Property] and
setDefault[Property] are working correctly setDefault[Property] are working correctly
""" """
self._addProperty('Person', 'Person_lang', 'available_language', self._addProperty('Person',
'test_19c_AcquiredTokensAccessor_Person',
'available_language',
commit=False, commit=False,
**self.DEFAULT_LANGUAGE_PROP) **self.DEFAULT_LANGUAGE_PROP)
self._addProperty('Email', 'Email_lang', 'available_language', self._addProperty('Email',
'test_19c_AcquiredTokensAccessor_Email',
'available_language',
**self.DEFAULT_LANGUAGE_PROP) **self.DEFAULT_LANGUAGE_PROP)
# Category setters (list, set, default) # Category setters (list, set, default)
...@@ -1281,7 +1298,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1281,7 +1298,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
setDefault[Property] are working correctly setDefault[Property] are working correctly
This test focus on acquisition_mask_value parameter This test focus on acquisition_mask_value parameter
""" """
self._addProperty('Person', 'Person_19c2', 'subordination_organisation_reference', self._addProperty('Person',
'test_19c2_AcquiredStringAccessor',
'subordination_organisation_reference',
**self.SUBORDINATION_ORGANISATION_REFERENCE) **self.SUBORDINATION_ORGANISATION_REFERENCE)
person = self.getPersonModule().newContent(portal_type='Person') person = self.getPersonModule().newContent(portal_type='Person')
...@@ -1327,7 +1346,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1327,7 +1346,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
setDefault[Property] are working correctly setDefault[Property] are working correctly
This test focus on acquisition_mask_value parameter This test focus on acquisition_mask_value parameter
""" """
self._addProperty('Person', 'Person_19c3', 'subordination_organisation_source_reference', self._addProperty('Person',
'test_19c3_AcquiredStringAccessor',
'subordination_organisation_source_reference',
**self.SUBORDINATION_ORGANISATION_SOURCE_REFERENCE) **self.SUBORDINATION_ORGANISATION_SOURCE_REFERENCE)
person = self.getPersonModule().newContent(portal_type='Person') person = self.getPersonModule().newContent(portal_type='Person')
...@@ -1381,12 +1402,17 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1381,12 +1402,17 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
Boolean accessors generate both an getPropertyName and an isPropertyName Boolean accessors generate both an getPropertyName and an isPropertyName
Check in particular that both behave the same way regarding acquisition Check in particular that both behave the same way regarding acquisition
""" """
self._addProperty('Person', 'Person_19d', 'name_included_in_address', self._addProperty('Person',
'test_19d_AcquiredBooleanAccessor_Person',
'name_included_in_address',
commit=False, commit=False,
portal_type='Standard Property', portal_type='Standard Property',
property_default="python: True", property_default="python: True",
elementary_type="boolean") elementary_type="boolean")
self._addProperty('Email', 'Email_19d', 'name_included_in_address', self._addProperty('Email',
'test_19d_AcquiredBooleanAccessor_Email',
'name_included_in_address',
'name_included_in_address',
content_acquired_property_id=('name_included_in_address', ), content_acquired_property_id=('name_included_in_address', ),
acquisition_base_category=( 'parent', ), acquisition_base_category=( 'parent', ),
acquisition_portal_type="python: ( 'Person', )", acquisition_portal_type="python: ( 'Person', )",
...@@ -1814,7 +1840,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -1814,7 +1840,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
"""Test 'has' Accessor. """Test 'has' Accessor.
This accessor returns true if the property is set on the document. This accessor returns true if the property is set on the document.
""" """
self._addProperty('Person', 'Person_foobar', 'foo_bar', self._addProperty('Person',
'test_26_hasAccessors',
'foo_bar',
elementary_type='string', elementary_type='string',
portal_type='Standard Property') portal_type='Standard Property')
obj = self.getPersonModule().newContent(portal_type='Person') obj = self.getPersonModule().newContent(portal_type='Person')
...@@ -2193,7 +2221,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2193,7 +2221,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
region_category.restrictedTraverse, "beta") region_category.restrictedTraverse, "beta")
# Define the acquired property # Define the acquired property
self._addProperty('Person', 'Person_test_unaccessible', 'wrapped_region_title', self._addProperty('Person',
'Person_test_unaccessible',
'wrapped_region_title',
portal_type='Acquired Property', portal_type='Acquired Property',
elementary_type='lines', elementary_type='lines',
description='The title of the region', description='The title of the region',
...@@ -2282,7 +2312,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2282,7 +2312,7 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
logged_errors[0].getMessage()) logged_errors[0].getMessage())
def test_list_accessors(self): def test_list_accessors(self):
self._addProperty('Person', 'Person_dummy', 'dummy', self._addProperty('Person', 'test_list_accessors', 'dummy',
elementary_type='lines', elementary_type='lines',
portal_type='Standard Property') portal_type='Standard Property')
module = self.getPersonModule() module = self.getPersonModule()
...@@ -2310,7 +2340,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2310,7 +2340,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self.assertEquals(person.getDummySet(), ['value']) self.assertEquals(person.getDummySet(), ['value'])
def test_translated_accessors(self): def test_translated_accessors(self):
self._addProperty('Person', 'Person_dummy', 'dummy', self._addProperty('Person',
'test_translated_accessors',
'dummy',
elementary_type='string', elementary_type='string',
translatable=1, translatable=1,
translation_domain='erp5_ui', translation_domain='erp5_ui',
...@@ -2546,7 +2578,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2546,7 +2578,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
def test_DefaultSecurityOnAccessors(self): def test_DefaultSecurityOnAccessors(self):
# Test accessors are protected correctly # Test accessors are protected correctly
self._addProperty('Person', 'Person_foobar', 'foo_bar', self._addProperty('Person',
'test_DefaultSecurityOnAccessors',
'foo_bar',
elementary_type='string', elementary_type='string',
portal_type='Standard Property') portal_type='Standard Property')
obj = self.getPersonModule().newContent(portal_type='Person') obj = self.getPersonModule().newContent(portal_type='Person')
...@@ -2567,7 +2601,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2567,7 +2601,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
def test_DefaultSecurityOnListAccessors(self): def test_DefaultSecurityOnListAccessors(self):
# Test list accessors are protected correctly # Test list accessors are protected correctly
self._addProperty('Person', 'Person_foobar', 'foo_bar', self._addProperty('Person',
'test_DefaultSecurityOnListAccessors',
'foo_bar',
elementary_type='lines', elementary_type='lines',
portal_type='Standard Property') portal_type='Standard Property')
obj = self.getPersonModule().newContent(portal_type='Person') obj = self.getPersonModule().newContent(portal_type='Person')
...@@ -2624,7 +2660,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2624,7 +2660,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
def test_PropertySheetSecurityOnAccessors(self): def test_PropertySheetSecurityOnAccessors(self):
# Test accessors are protected correctly when you specify the permission # Test accessors are protected correctly when you specify the permission
# in the property sheet. # in the property sheet.
self._addProperty('Person', 'Person_foobar', 'foo_bar', self._addProperty('Person',
'test_PropertySheetSecurityOnAccessors',
'foo_bar',
elementary_type='string', elementary_type='string',
write_permission='Set own password', write_permission='Set own password',
read_permission='Manage users', read_permission='Manage users',
...@@ -2643,7 +2681,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2643,7 +2681,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
self.assertFalse(guarded_hasattr(obj, 'getFooBar')) self.assertFalse(guarded_hasattr(obj, 'getFooBar'))
def test_edit(self): def test_edit(self):
self._addProperty('Person', 'Person_foobar', 'foo_bar', self._addProperty('Person',
'test_edit',
'foo_bar',
elementary_type='string', elementary_type='string',
write_permission='Set own password', write_permission='Set own password',
read_permission='Manage users', read_permission='Manage users',
...@@ -2724,7 +2764,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2724,7 +2764,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
Check that we can use setPropertyList and getPropertyList Check that we can use setPropertyList and getPropertyList
on a mono valued property on a mono valued property
""" """
self._addProperty('Person', 'Person_foobar', 'foo_bar', self._addProperty('Person',
'testPropertyListWithMonoValuedProperty',
'foo_bar',
elementary_type='string', elementary_type='string',
portal_type='Standard Property') portal_type='Standard Property')
person = self.getPersonModule().newContent(portal_type='Person') person = self.getPersonModule().newContent(portal_type='Person')
...@@ -2750,11 +2792,15 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2750,11 +2792,15 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
Check that we can use setPropertyList and getPropertyList Check that we can use setPropertyList and getPropertyList
on a mono valued acquired property on a mono valued acquired property
""" """
self._addProperty('Person', 'Person_foobar', 'foo_bar', self._addProperty('Person',
'testPropertyListOnMonoValuedAcquiredProperty_Person',
'foo_bar',
commit=False, commit=False,
elementary_type='string', elementary_type='string',
portal_type='Standard Property') portal_type='Standard Property')
self._addProperty('Email', 'Email_foobar', 'foo_bar', self._addProperty('Email',
'testPropertyListOnMonoValuedAcquiredProperty_Email',
'foo_bar',
elementary_type='string', elementary_type='string',
portal_type='Acquired Property', portal_type='Acquired Property',
content_acquired_property_id=('description', ), content_acquired_property_id=('description', ),
...@@ -2780,7 +2826,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): ...@@ -2780,7 +2826,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor):
Check that we can use setPropertyList and getPropertyList Check that we can use setPropertyList and getPropertyList
on a multi valued property on a multi valued property
""" """
self._addProperty('Person', 'Person_foobar', 'foo_bar', self._addProperty('Person',
'testPropertyListWithMultiValuedProperty',
'foo_bar',
elementary_type='lines', elementary_type='lines',
portal_type='Standard Property') portal_type='Standard Property')
person = self.getPersonModule().newContent(portal_type='Person') person = self.getPersonModule().newContent(portal_type='Person')
......
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