Commit 55c53707 authored by Łukasz Nowak's avatar Łukasz Nowak

Restore Internal Packing List Line constraints.

parent 273c8b39
......@@ -6,6 +6,18 @@
</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>
......@@ -32,6 +44,14 @@
<key> <string>max_arity</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>message_arity_not_in_range</string> </key>
<value> <string>There should be exactly one ${portal_type} present in Items</string> </value>
</item>
<item>
<key> <string>message_arity_too_small</string> </key>
<value> <string>There should be exactly one ${portal_type} present in Items</string> </value>
</item>
<item>
<key> <string>message_arity_with_portal_type_not_in_range</string> </key>
<value> <string>There should be exactly one ${portal_type} present in Items</string> </value>
......@@ -55,4 +75,34 @@
</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>
......@@ -6,6 +6,35 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>message_property_not_set</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_property</string> </key>
<value>
......@@ -22,6 +51,14 @@
<key> <string>id</string> </key>
<value> <string>quantity_existence_constraint</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Property quantity must be defined</string> </value>
</item>
<item>
<key> <string>message_property_not_set</string> </key>
<value> <string>Property quantity must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Existence Constraint</string> </value>
......@@ -33,4 +70,34 @@
</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>
......@@ -6,6 +6,18 @@
</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>
......@@ -30,6 +42,22 @@
<key> <string>max_arity</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>message_arity_not_in_range</string> </key>
<value> <string>Resource must be defined</string> </value>
</item>
<item>
<key> <string>message_arity_too_small</string> </key>
<value> <string>Resource must be defined</string> </value>
</item>
<item>
<key> <string>message_arity_with_portal_type_not_in_range</string> </key>
<value> <string>Resource must be defined</string> </value>
</item>
<item>
<key> <string>message_arity_with_portal_type_too_small</string> </key>
<value> <string>Resource must be defined</string> </value>
</item>
<item>
<key> <string>min_arity</string> </key>
<value> <int>1</int> </value>
......@@ -49,4 +77,34 @@
</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>
......@@ -236,3 +236,51 @@ class TestVifibInternalPackingListConstraint(testVifibMixin):
self.assertTrue(consistency_message in getMessageList(ipl))
ipl.newContent(portal_type='Internal Packing List Line')
self.assertFalse(consistency_message in getMessageList(ipl))
class TestVifibInternalPackingListLineConstraint(testVifibMixin):
def getTitle(self):
return "Vifib Internal Packing List Line Constraint checks"
def test_quantity_existence(self):
ipl = self.portal.internal_packing_list_module.newContent(
portal_type='Internal Packing List')
ipl.confirm()
line = ipl.newContent(portal_type='Internal Packing List Line')
consistency_message = 'Property quantity must be defined'
self.assertTrue(consistency_message in getMessageList(line))
line.setQuantity(1.0)
self.assertFalse(consistency_message in getMessageList(line))
def test_resource(self):
ipl = self.portal.internal_packing_list_module.newContent(
portal_type='Internal Packing List')
ipl.confirm()
line = ipl.newContent(portal_type='Internal Packing List Line')
consistency_message = 'Resource must be defined'
self.assertTrue(consistency_message in getMessageList(line))
resource = self.portal.service_module.newContent(portal_type='Service')
line.setResource(resource.getRelativeUrl())
self.assertFalse(consistency_message in getMessageList(line))
def test_aggregate_computer(self):
ipl = self.portal.internal_packing_list_module.newContent(
portal_type='Internal Packing List')
ipl.confirm()
line = ipl.newContent(portal_type='Internal Packing List Line')
consistency_message = 'There should be exactly one Computer present in Items'
self.assertTrue(consistency_message in getMessageList(line))
aggregate = self.portal.computer_module.newContent(portal_type='Computer')
line.setAggregate(aggregate.getRelativeUrl())
self.assertFalse(consistency_message in getMessageList(line))
196
\ No newline at end of file
197
\ 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