Commit 5ecbd829 authored by Łukasz Nowak's avatar Łukasz Nowak

Restore Purchase Packing List Line constraints.

parent 26fd3cd6
...@@ -28,6 +28,10 @@ ...@@ -28,6 +28,10 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>VifibPurchasePackingListConstraint</string> </value> <value> <string>VifibPurchasePackingListConstraint</string> </value>
</item> </item>
<item>
<key> <string>last_id</string> </key>
<value> <string>1</string> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value> <value> <string>Property Sheet</string> </value>
......
...@@ -6,18 +6,40 @@ ...@@ -6,18 +6,40 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <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> <item>
<key> <string>constraint_portal_type</string> </key> <key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Purchase Packing List Line\',)</string> </value> <value> <string>python: (\'Purchase Packing List Line\',)</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Purchase Packing List Line is not defined</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>lines_constraint</string> </value> <value> <string>lines_constraint</string> </value>
</item> </item>
<item>
<key> <string>message_no_subobject</string> </key>
<value> <string>Purchase Packing List Line is not defined</string> </value>
</item>
<item>
<key> <string>message_no_subobject_portal_type</string> </key>
<value> <string>Purchase Packing List Line is not defined</string> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Content Existence Constraint</string> </value> <value> <string>Content Existence Constraint</string> </value>
...@@ -25,4 +47,34 @@ ...@@ -25,4 +47,34 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="String Attribute Match 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>_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>
<tuple>
<string>reference</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>reference_not_empty_constraint</string> </value>
</item>
<item>
<key> <string>message_attribute_match</string> </key>
<value> <string>Reference must be defined</string> </value>
</item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Reference must be defined</string> </value>
</item>
<item>
<key> <string>message_property_not_set</string> </key>
<value> <string>Reference must be defined</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>String Attribute Match Constraint</string> </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>
...@@ -6,6 +6,35 @@ ...@@ -6,6 +6,35 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <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> <item>
<key> <string>constraint_property</string> </key> <key> <string>constraint_property</string> </key>
<value> <value>
...@@ -16,12 +45,22 @@ ...@@ -16,12 +45,22 @@
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string>Property start_date must be defined</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>start_date_existence_constraint</string> </value> <value> <string>start_date_existence_constraint</string> </value>
</item> </item>
<item>
<key> <string>message_no_such_property</string> </key>
<value> <string>Property start_date must be defined</string> </value>
</item>
<item>
<key> <string>message_property_not_set</string> </key>
<value> <string>Property start_date must be defined</string> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Property Existence Constraint</string> </value> <value> <string>Property Existence Constraint</string> </value>
...@@ -29,4 +68,34 @@ ...@@ -29,4 +68,34 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -285,7 +285,7 @@ class TestVifibInternalPackingListLineConstraint(testVifibMixin): ...@@ -285,7 +285,7 @@ class TestVifibInternalPackingListLineConstraint(testVifibMixin):
self.assertFalse(consistency_message in getMessageList(line)) self.assertFalse(consistency_message in getMessageList(line))
class testVifibPersonConstraint(testVifibMixin): class TestVifibPersonConstraint(testVifibMixin):
def getTitle(self): def getTitle(self):
return "Vifib Person Constraint checks" return "Vifib Person Constraint checks"
...@@ -336,3 +336,43 @@ class testVifibPersonConstraint(testVifibMixin): ...@@ -336,3 +336,43 @@ class testVifibPersonConstraint(testVifibMixin):
person.newContent(portal_type='Email') person.newContent(portal_type='Email')
self.assertFalse(consistency_message in getMessageList(person)) self.assertFalse(consistency_message in getMessageList(person))
class TestVifibPurchasePackingListConstraint(testVifibMixin):
def getTitle(self):
return "Vifib Purchase Packing List Constraint checks"
def test_reference_not_empty(self):
ppl = self.portal.purchase_packing_list_module.newContent(
portal_type='Purchase Packing List')
consistency_message = 'Reference must be defined'
# reset reference, as set during object creation
ppl.setReference(None)
self.assertTrue(consistency_message in getMessageList(ppl))
ppl.setReference(rndstr())
self.assertFalse(consistency_message in getMessageList(ppl))
def test_start_date_existence(self):
ppl = self.portal.purchase_packing_list_module.newContent(
portal_type='Purchase Packing List')
consistency_message = 'Property start_date must be defined'
self.assertTrue(consistency_message in getMessageList(ppl))
ppl.setStartDate('2011/01/01')
self.assertFalse(consistency_message in getMessageList(ppl))
def test_lines(self):
ppl = self.portal.purchase_packing_list_module.newContent(
portal_type='Purchase Packing List')
consistency_message = 'Purchase Packing List Line is not defined'
self.assertTrue(consistency_message in getMessageList(ppl))
ppl.newContent(portal_type='Purchase Packing List Line')
self.assertFalse(consistency_message in getMessageList(ppl))
198 199
\ No newline at end of file \ 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