Commit 14a866f6 authored by Jérome Perrin's avatar Jérome Perrin

this test was bad. you cannot add Organisation inside Organisation.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12827 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5b227ec2
...@@ -1150,10 +1150,18 @@ class TestConstraint(PropertySheetTestCase): ...@@ -1150,10 +1150,18 @@ class TestConstraint(PropertySheetTestCase):
'portal_type': ('Organisation', ), 'portal_type': ('Organisation', ),
'acquired_property_id': ('title', ), 'acquired_property_id': ('title', ),
'mode': 'w', }''') 'mode': 'w', }''')
constraint.fixConsistency(obj) # this property suppose that we can add some Organisation inside
self.assertEquals('foo', obj.getDefaultOrganisationTitle()) # Organisation, so we temporary patch the type information.
self.assertEquals('foo', obj.default_organisation.getTitle()) ti = self.getTypesTool().getTypeInfo(obj)
allowed_types = list(ti.allowed_content_types)
ti.allowed_content_types = allowed_types + ['Organisation']
try:
constraint.fixConsistency(obj)
self.assertEquals('foo', obj.getDefaultOrganisationTitle())
self.assertEquals('foo', obj.default_organisation.getTitle())
finally:
ti.allowed_content_types = tuple(allowed_types)
def test_PropertyTypeValidityFixLocalPropertiesForCategories(self): def test_PropertyTypeValidityFixLocalPropertiesForCategories(self):
"""Tests PropertyTypeValidity can repairs categories when this property """Tests PropertyTypeValidity can repairs categories when this property
is added on the class later. is added on the class later.
......
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