Commit 2008a777 authored by Romain Courteaud's avatar Romain Courteaud

Call setter instead of edit, in order to always modify the property value.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13407 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fd7e1b9e
...@@ -155,7 +155,7 @@ class TestConstraint(PropertySheetTestCase): ...@@ -155,7 +155,7 @@ class TestConstraint(PropertySheetTestCase):
""" """
object = sequence.get('object') object = sequence.get('object')
object_title = self.object_title object_title = self.object_title
object.edit(title=object_title) object.setTitle(object_title)
def stepSetObjectNoneTitle(self, sequence=None, def stepSetObjectNoneTitle(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
...@@ -163,8 +163,9 @@ class TestConstraint(PropertySheetTestCase): ...@@ -163,8 +163,9 @@ class TestConstraint(PropertySheetTestCase):
Set a different title value Set a different title value
""" """
object = sequence.get('object') object = sequence.get('object')
object_title = self.object_title # Do not call edit, as we want to explicitely modify the property
object.edit(title=None) # (and edit modify only if value is different)
object.setTitle(None)
def stepSetObjectEmptyTitle(self, sequence=None, def stepSetObjectEmptyTitle(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
...@@ -172,8 +173,9 @@ class TestConstraint(PropertySheetTestCase): ...@@ -172,8 +173,9 @@ class TestConstraint(PropertySheetTestCase):
Set a different title value Set a different title value
""" """
object = sequence.get('object') object = sequence.get('object')
object_title = self.object_title # Do not call edit, as we want to explicitely modify the property
object.edit(title='') # (and edit modify only if value is different)
method = object.setTitle('')
def stepSetObjectIntTitle(self, sequence=None, def stepSetObjectIntTitle(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
...@@ -251,7 +253,7 @@ class TestConstraint(PropertySheetTestCase): ...@@ -251,7 +253,7 @@ class TestConstraint(PropertySheetTestCase):
def stepCallRelatedCheckConsistency(self, sequence=None, def stepCallRelatedCheckConsistency(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
""" """
Call checkConsistency of a Constraint. Call checkConsistency of a Constraint.
""" """
object = sequence.get('group') object = sequence.get('group')
constraint = sequence.get('constraint') constraint = sequence.get('constraint')
...@@ -264,20 +266,20 @@ class TestConstraint(PropertySheetTestCase): ...@@ -264,20 +266,20 @@ class TestConstraint(PropertySheetTestCase):
def stepCheckIfConstraintSucceeded(self, sequence=None, def stepCheckIfConstraintSucceeded(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
""" """
Call checkConsistency of a Constraint. Check that checkConsistency returns an empty list
""" """
error_list = sequence.get('error_list') error_list = sequence.get('error_list')
self.failIfDifferentSet(error_list, [], self.failIfDifferentSet(error_list, [],
"error_list : %s" % error_list) "error_list : %s" % [x.message for x in error_list])
def stepCheckIfConstraintFailed(self, sequence=None, def stepCheckIfConstraintFailed(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
""" """
Call checkConsistency of a Constraint. Check that checkConsistency does not return an empty list
""" """
error_list = sequence.get('error_list') error_list = sequence.get('error_list')
self.failUnless(error_list != [], self.failUnless(error_list != [],
"error_list : %s" % error_list) "error_list : %s" % error_list)
def stepCreateConstraint(self, sequence=None, def stepCreateConstraint(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
...@@ -403,14 +405,26 @@ class TestConstraint(PropertySheetTestCase): ...@@ -403,14 +405,26 @@ class TestConstraint(PropertySheetTestCase):
CheckIfConstraintSucceeded \ CheckIfConstraintSucceeded \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
# Test Constraint without title property
# on object
sequence_string = '\
CreateObject \
CreatePropertyExistence2 \
CallCheckConsistency \
CheckIfConstraintFailed \
'
sequence_list.addSequenceString(sequence_string)
# Test Constraint with property defined on object # Test Constraint with property defined on object
# With None value # With None value
# None is considered as a NULL value for string
# and so, is considered as a data
sequence_string = '\ sequence_string = '\
CreateObject \ CreateObject \
SetObjectNoneTitle \ SetObjectNoneTitle \
CreatePropertyExistence2 \ CreatePropertyExistence2 \
CallCheckConsistency \ CallCheckConsistency \
CheckIfConstraintFailed \ CheckIfConstraintSucceeded \
' '
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
# Test Constraint with property defined on object # Test Constraint with property defined on object
......
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