Commit ffd9672a authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test: complexify the calculation

parent a2c10fa9
...@@ -75,7 +75,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -75,7 +75,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
with PinnedDateTime(self, DateTime('2024/01/29')): with PinnedDateTime(self, DateTime('2024/01/29')):
public_reference = 'public-%s' % self.generateNewId() public_reference = 'public-%s' % self.generateNewId()
self.joinSlapOS(self.web_site, public_reference) self.joinSlapOS(self.web_site, public_reference)
with PinnedDateTime(self, DateTime('2024/01/31')): with PinnedDateTime(self, DateTime('2024/02/01')):
public_reference2 = 'public2-%s' % self.generateNewId() public_reference2 = 'public2-%s' % self.generateNewId()
self.joinSlapOS(self.web_site, public_reference2) self.joinSlapOS(self.web_site, public_reference2)
...@@ -95,7 +95,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -95,7 +95,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
public_instance_title = 'Public title %s' % self.generateNewId() public_instance_title = 'Public title %s' % self.generateNewId()
self.login(person_user_id) self.login(person_user_id)
with PinnedDateTime(self, DateTime('2024/02/03')): with PinnedDateTime(self, DateTime('2024/02/10')):
self.personRequestInstanceNotReady( self.personRequestInstanceNotReady(
software_release=software_release, software_release=software_release,
software_type=software_type, software_type=software_type,
...@@ -113,7 +113,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -113,7 +113,7 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
self.checkServiceSubscriptionRequest(instance_tree) self.checkServiceSubscriptionRequest(instance_tree)
self.tic() self.tic()
with PinnedDateTime(self, DateTime('2024/02/10')): with PinnedDateTime(self, DateTime('2024/02/25')):
self.login(sale_person.getUserId()) self.login(sale_person.getUserId())
subscription_change_request = public_person2.Person_claimSlaposItemSubscription( subscription_change_request = public_person2.Person_claimSlaposItemSubscription(
instance_tree.getReference(), instance_tree.getReference(),
...@@ -150,7 +150,8 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe ...@@ -150,7 +150,8 @@ class TestSlapOSSubscriptionChangeRequestScenario(TestSlapOSSubscriptionChangeRe
} }
inventory_list = self.portal.portal_simulation.getCurrentInventoryList(**inventory_list_kw) inventory_list = self.portal.portal_simulation.getCurrentInventoryList(**inventory_list_kw)
self.assertEquals(1, len(inventory_list)) self.assertEquals(1, len(inventory_list))
self.assertEquals(-1, inventory_list[0].total_quantity) # 1 - 0.42 (13 days of 31) - 0.1 (3 days of 31) + 1 - 0.83 (24 days of 29)
self.assertEquals(-0.65, inventory_list[0].total_quantity)
inventory_list_kw = { inventory_list_kw = {
'group_by_section': False, 'group_by_section': False,
......
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