Commit d17eb0dc authored by Romain Courteaud's avatar Romain Courteaud

Drop not needed constraint.

Such assertion is already provided by
slapos_assert_hosting_subscription_predecessor alarm.
parent 493171c3
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Membership Arity Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>predecessor</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Software Instance\', \'Slave Instance\')</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>predecessor_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>max_arity</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>min_arity</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Membership Arity Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: here.getSlapState() != \'draft\'</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -397,43 +397,6 @@ class TestSlapOSHostingSubscriptionConstraint(TestSlapOSConstraintMixin):
'start_requested')
self._test_property_existence(property_id, consistency_message)
def test_predecessor_related(self):
self.portal.portal_workflow._jumpToStateFor(self.software_instance,
'start_requested')
software_instance2 = self.portal.software_instance_module.newContent(
portal_type='Software Instance')
software_instance3 = self.portal.software_instance_module.newContent(
portal_type='Software Instance')
self.software_instance.setPredecessor(software_instance2.getRelativeUrl())
# fetch basic list of consistency messages
current_message_list = getMessageList(self.software_instance)
consistency_message = "Arity Error for Relation ['predecessor'], arity is "\
"equal to 0 but should be at least 1"
# test the test: no expected message found
self.assertFalse(consistency_message in current_message_list)
# 0 is bad
self.software_instance.setPredecessor(None)
self.assertTrue(consistency_message in getMessageList(self.software_instance))
# Note: There is (nonsense) constraint
# SlaposHostingSubscriptionConstraint/predecessor_constraint which
# defines minimum as 0, thats why this test will fail
# one is good
self.software_instance.edit(predecessor=software_instance2.getRelativeUrl())
self.assertFalse(consistency_message in getMessageList(self.software_instance))
self.assertSameSet(current_message_list, getMessageList(self.software_instance))
# more then one is good
self.software_instance.edit(predecessor_list=[software_instance2.getRelativeUrl(),
software_instance3.getRelativeUrl()])
self.assertFalse(consistency_message in getMessageList(self.software_instance))
self.assertSameSet(current_message_list, getMessageList(self.software_instance))
class TestSlapOSPersonConstraint(testSlapOSMixin):
def test_role(self):
......
232
\ No newline at end of file
233
\ No newline at end of file
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