Commit bb8a0dd1 authored by Łukasz Nowak's avatar Łukasz Nowak

Follow code changes.

parent 8a3f8a81
import unittest import unittest
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from testVifibSlapWebService import TestVifibSlapWebServiceMixin from testVifibSlapWebService import TestVifibSlapWebServiceMixin
from Products.ERP5Type.DateUtils import getClosestDate, getNumberOfDayInMonth from Products.ERP5Type.DateUtils import getClosestDate, addToDate
from DateTime import DateTime from DateTime import DateTime
class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
...@@ -30,7 +30,10 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin): ...@@ -30,7 +30,10 @@ class TestVifibInstanceHostingRelatedDocument(TestVifibSlapWebServiceMixin):
if item.get('simulation_state') == 'stopped': if item.get('simulation_state') == 'stopped':
start_date = item.get('time') start_date = item.get('time')
break break
stop_date = start_date + getNumberOfDayInMonth(start_date) start_date = getClosestDate(target_date=start_date, precision='day')
while start_date.day() >= 29:
start_date = addToDate(start_date, to_add={'day': -1})
stop_date = addToDate(start_date, to_add={'month': 1})
idx = 0 idx = 0
for delivery in delivery_list: for delivery in delivery_list:
self.assertEqual(start_date, delivery.getStartDate()) self.assertEqual(start_date, delivery.getStartDate())
......
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