Commit 117bd6f5 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Update TestZodbPropertySheet following changes made in r42928



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43038 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2febf7d1
...@@ -403,21 +403,23 @@ class TestZodbPropertySheet(ERP5TypeTestCase): ...@@ -403,21 +403,23 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
portal_type='Content Existence Constraint', portal_type='Content Existence Constraint',
constraint_portal_type='python: ("Content Existence Constraint")') constraint_portal_type='python: ("Content Existence Constraint")')
def _newCategoryMembershipArityConstraint(self, reference, portal_type): def _newCategoryMembershipArityConstraint(self,
reference,
use_acquisition=False):
""" """
Create a new Category Membership Arity Constraint within test Create a new Category Membership Arity Constraint within test
Property Sheet, allowing testing of Category Acquired Membership Property Sheet (with or without acquisition)
Arity Constraint too
""" """
self.getPortal().portal_categories.newContent( self.getPortal().portal_categories.newContent(
id=reference, portal_type='Base Category') id=reference, portal_type='Base Category')
self.test_property_sheet.newContent( self.test_property_sheet.newContent(
reference=reference, reference=reference,
portal_type=portal_type, portal_type='Category Membership Arity Constraint',
min_arity=1, min_arity=1,
max_arity=1, max_arity=1,
constraint_portal_type=('Test Migration',), use_acquisition=use_acquisition,
constraint_portal_type="python: ('Test Migration',)",
constraint_base_category=(reference,)) constraint_base_category=(reference,))
def _newCategoryRelatedMembershipArityConstraint(self): def _newCategoryRelatedMembershipArityConstraint(self):
...@@ -431,7 +433,7 @@ class TestZodbPropertySheet(ERP5TypeTestCase): ...@@ -431,7 +433,7 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
portal_type='Category Related Membership Arity Constraint', portal_type='Category Related Membership Arity Constraint',
min_arity=1, min_arity=1,
max_arity=1, max_arity=1,
constraint_portal_type=('Test Migration',), constraint_portal_type="python: ('Test Migration',)",
constraint_base_category=('gender',)) constraint_base_category=('gender',))
def _newTALESConstraint(self): def _newTALESConstraint(self):
...@@ -486,17 +488,16 @@ class TestZodbPropertySheet(ERP5TypeTestCase): ...@@ -486,17 +488,16 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
# Sheet # Sheet
self._newContentExistenceConstraint() self._newContentExistenceConstraint()
# Create a Category Membership Arity Constraint in the test # Create a Category Membership Arity Constraint without
# Property Sheet # acquisition in the test Property Sheet
self._newCategoryMembershipArityConstraint( self._newCategoryMembershipArityConstraint(
'test_category_membership_arity_constraint', 'test_category_membership_arity_constraint')
'Category Membership Arity Constraint')
# Create a Category Acquired Membership Arity Constraint in the # Create a Category Membership Arity Constraint with acquisition
# test Property Sheet # in the test Property Sheet
self._newCategoryMembershipArityConstraint( self._newCategoryMembershipArityConstraint(
'test_category_acquired_membership_arity_constraint', 'test_category_membership_arity_constraint_with_acquisition',
'Category Acquired Membership Arity Constraint') use_acquisition=True)
# Create a Category Related Membership Arity Constraint in the # Create a Category Related Membership Arity Constraint in the
# test Property Sheet # test Property Sheet
...@@ -942,7 +943,7 @@ class TestZodbPropertySheet(ERP5TypeTestCase): ...@@ -942,7 +943,7 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
('test_category_membership_arity_constraint/'\ ('test_category_membership_arity_constraint/'\
'Test Migration',)) 'Test Migration',))
def testCategoryAcquiredMembershipArityConstraint(self): def testCategoryMembershipArityConstraintWithAcquisition(self):
""" """
Take the test module and check whether the Category Acquired Take the test module and check whether the Category Acquired
Membership Arity Constraint is there. Until a Base Category is set Membership Arity Constraint is there. Until a Base Category is set
...@@ -951,9 +952,9 @@ class TestZodbPropertySheet(ERP5TypeTestCase): ...@@ -951,9 +952,9 @@ class TestZodbPropertySheet(ERP5TypeTestCase):
XXX: Test with acquisition? XXX: Test with acquisition?
""" """
self._checkConstraint( self._checkConstraint(
'test_category_acquired_membership_arity_constraint', 'test_category_membership_arity_constraint_with_acquisition',
self.test_module.setCategoryList, self.test_module.setCategoryList,
('test_category_acquired_membership_arity_constraint/Test Migration',)) ('test_category_membership_arity_constraint_with_acquisition/Test Migration',))
def testCategoryRelatedMembershipArityConstraint(self): def testCategoryRelatedMembershipArityConstraint(self):
""" """
......
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