Commit b18aa690 authored by Hervé Poulain's avatar Hervé Poulain

Add unit test for check the multivalued properties with the

PropertyTypeValidity.

Remove some useles white spaces.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31639 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c41819aa
......@@ -995,7 +995,6 @@ class TestConstraint(PropertySheetTestCase):
obj.setGroup('testGroup1')
self.assertEquals(0, len(constraint.checkConsistency(obj)))
def stepCreateCategoryRelatedMembershipArity0(self, sequence=None,
sequence_list=None, **kw):
"""
......@@ -1479,6 +1478,24 @@ class TestConstraint(PropertySheetTestCase):
self.assertNotEquals("Attribute source_title should be of type string but is of type <type 'int'>",
str(error_list[0].getMessage()))
def test_PropertyTypeValidityForMultivaluedProperty(self):
"""
This test allows to check that a multivalued property which defines a
type is composed of a list of elements of this type.
"""
constraint = self._createGenericConstraint(
klass_name='PropertyTypeValidity',
id='multi_valuated_property', )
obj = self._makeOne()
self._addProperty(obj.getPortalType(),
'''{'id': 'multi_valuated_property',
'type': 'float',
'multivalued': 1,
'mode': 'w', }''')
obj.edit(multi_valuated_property=[1.0, 2.0, 3.0, ])
self.assertEquals([], constraint.checkConsistency(obj))
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestConstraint))
......
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