Commit ff280e4f authored by Romain Courteaud's avatar Romain Courteaud

Be sure that the effective date of the 2 newly created open order are differents.

It prevent random access during the Hosting Subscription expand.
parent 0e157ff2
......@@ -66,7 +66,7 @@ if portal.portal_activities.countMessageWithTag(tag) > 0:\n
\n
def newOpenOrder(open_sale_order):\n
open_order_edit_kw = {\n
\'effective_date\': now,\n
\'effective_date\': DateTime(),\n
\'activate_kw\': activate_kw,\n
}\n
if open_sale_order is None:\n
......
......@@ -1259,6 +1259,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
portal_type='Open Sale Order Line')
self.assertEqual(1, len(open_sale_order_line_list))
effective_date = open_sale_order.getEffectiveDate()
line = open_sale_order_line_list[0].getObject()
self.assertEqual(subscription.getRelativeUrl(), line.getAggregate())
......@@ -1279,9 +1280,12 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
new_open_sale_order = [x for x in open_sale_order_list \
if x.getValidationState() == 'validated'][0].getObject()
self.assertEqual('validated', new_open_sale_order.getValidationState())
new_effective_date = new_open_sale_order.getEffectiveDate()
open_sale_order_line_list = new_open_sale_order.contentValues(
portal_type='Open Sale Order Line')
self.assertEqual(0, len(open_sale_order_line_list))
self.assertTrue(new_effective_date > effective_date,
"%s <= %s" % (new_effective_date, effective_date))
class TestSlapOSTriggerBuildAlarm(testSlapOSMixin):
@simulateByTitlewMark('SimulationMovement_buildSlapOS')
......
254
\ No newline at end of file
255
\ 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