Commit 04888bac authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Update Tests, Open sale order with no Lines are automatically archived

parent 92bc991b
Pipeline #10692 failed with stage
in 0 seconds
...@@ -625,8 +625,14 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin): ...@@ -625,8 +625,14 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self.assertEqual(2, len(open_sale_order_list)) self.assertEqual(2, len(open_sale_order_list))
open_sale_order = [q for q in open_sale_order_list archived_open_sale_order_list = [q for q in open_sale_order_list
if q.getValidationState() == 'archived'][0] if q.getValidationState() == 'archived']
archived_open_sale_order_list.sort(key=lambda x: x.getCreationDate())
# Select the first archived
open_sale_order = archived_open_sale_order_list[0]
line_list = open_sale_order.contentValues( line_list = open_sale_order.contentValues(
portal_type='Open Sale Order Line') portal_type='Open Sale Order Line')
self.assertEqual(len(hosting_subscription_list), len(line_list)) self.assertEqual(len(hosting_subscription_list), len(line_list))
...@@ -635,9 +641,14 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin): ...@@ -635,9 +641,14 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
[q.getAggregate() for q in line_list] [q.getAggregate() for q in line_list]
) )
validated_open_sale_order = [q for q in open_sale_order_list validated_open_sale_order_list = [q for q in open_sale_order_list
if q.getValidationState() == 'validated'][0] if q.getValidationState() == 'validated']
line_list = validated_open_sale_order.contentValues(
# if no line, all open orders are kept archived
self.assertEqual(len(validated_open_sale_order_list), 0)
latest_open_sale_order = archived_open_sale_order_list[-1]
line_list = latest_open_sale_order.contentValues(
portal_type='Open Sale Order Line') portal_type='Open Sale Order Line')
self.assertEqual(len(line_list), 0) self.assertEqual(len(line_list), 0)
......
...@@ -100,11 +100,13 @@ ...@@ -100,11 +100,13 @@
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -117,7 +119,9 @@ ...@@ -117,7 +119,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
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