diff --git a/product/ERP5Type/tests/testConstraint.py b/product/ERP5Type/tests/testConstraint.py index 704156ce0388bdf2d2aab5b48be06cb25b182e07..24e557832e9fd1dea85ce48214de1b04908c2623 100644 --- a/product/ERP5Type/tests/testConstraint.py +++ b/product/ERP5Type/tests/testConstraint.py @@ -1449,11 +1449,22 @@ class TestConstraint(PropertySheetTestCase): id='testGroup3')) group3.manage_permission('Access contents information', ['Manager'], 0) assignment.setSourceValue(group3) - # Manager can access testGroup3 - self.assertEquals([], person.checkConsistency()) + # modify title attribute directly to violate PropertyTypeValidity + # constraint. + group3.title=123 + # Manager can access testGroup3, so full information is included in + # the error message. + error_list = person.checkConsistency() + self.assertEquals(1, len(error_list)) + self.assertEquals("Attribute source_title should be of type string but is of type <type 'int'>", + str(error_list[0].getMessage())) self.stepLoginAsAssignee() - # Assignee cannot access testGroup3 - self.assertEquals([], person.checkConsistency()) + # Assignee cannot access testGroup3, so full information is not + # included in the error message. + error_list = person.checkConsistency() + self.assertEquals(1, len(error_list)) + self.assertNotEquals("Attribute source_title should be of type string but is of type <type 'int'>", + str(error_list[0].getMessage())) def test_suite(): suite = unittest.TestSuite()