Commit 261e70fc authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5:

* test: create deposit payment to validate the subscription
* test: update related document count
parent 04867d52
...@@ -405,8 +405,8 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -405,8 +405,8 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
currency, _, _, sale_person = self.bootstrapVirtualMasterTest() currency, _, _, sale_person = self.bootstrapVirtualMasterTest()
self.logout() self.logout()
# lets join as slapos administrator, which will own few compute_nodes # lets join as slapos administrator, which will manager the project
owner_reference = 'owner-%s' % self.generateNewId() owner_reference = 'project-%s' % self.generateNewId()
self.joinSlapOS(self.web_site, owner_reference) self.joinSlapOS(self.web_site, owner_reference)
self.login() self.login()
...@@ -432,6 +432,9 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -432,6 +432,9 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
self.login() self.login()
project = self.portal.restrictedTraverse(project_relative_url) project = self.portal.restrictedTraverse(project_relative_url)
payment_transaction = owner_person.Person_addDepositPayment(99*10, currency.getRelativeUrl(), 1)
payment_transaction.PaymentTransaction_acceptDepositPayment()
preference = self.portal.portal_preferences.slapos_default_system_preference preference = self.portal.portal_preferences.slapos_default_system_preference
preference.edit( preference.edit(
preferred_subscription_assignment_category_list=[ preferred_subscription_assignment_category_list=[
...@@ -524,6 +527,9 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -524,6 +527,9 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
portal_type="ERP5 Login", portal_type="ERP5 Login",
reference=public_reference).getParentValue() reference=public_reference).getParentValue()
payment_transaction = public_person.Person_addDepositPayment(99*10, currency.getRelativeUrl(), 1)
payment_transaction.PaymentTransaction_acceptDepositPayment()
public_instance_title = 'Public title %s' % self.generateNewId() public_instance_title = 'Public title %s' % self.generateNewId()
self.checkInstanceAllocation(public_person.getUserId(), self.checkInstanceAllocation(public_person.getUserId(),
public_reference, public_instance_title, public_reference, public_instance_title,
...@@ -575,8 +581,9 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -575,8 +581,9 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# Check accounting # Check accounting
transaction_list = self.portal.account_module.receivable.Account_getAccountingTransactionList(mirror_section_uid=public_person.getUid()) transaction_list = self.portal.account_module.receivable.Account_getAccountingTransactionList(mirror_section_uid=public_person.getUid())
assert len(transaction_list) == 1, len(transaction_list) assert len(transaction_list) == 2, len(transaction_list)
assert transaction_list[0].total_price == 10.8, transaction_list[0].total_price assert transaction_list[0].total_price == 990.0, transaction_list[0].total_price
assert transaction_list[1].total_price == -990.0, transaction_list[1].total_price
self.login() self.login()
...@@ -741,12 +748,13 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -741,12 +748,13 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 9 open sale order / line # 9 open sale order / line
# 2 assignment # 2 assignment
# 4 simulation movement # 4 simulation movement
# 4 sale packing list
# 2 sale trade condition # 2 sale trade condition
# 1 software installation # 1 software installation
# 2 software instance # 2 software instance
# 2 software product # 2 software product
# 4 subscription request # 4 subscription request
self.assertRelatedObjectCount(project, 37) self.assertRelatedObjectCount(project, 41)
self.checkERP5StateBeforeExit() self.checkERP5StateBeforeExit()
...@@ -857,11 +865,14 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin): ...@@ -857,11 +865,14 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# 1 instance tree # 1 instance tree
# 6 open sale order / line # 6 open sale order / line
# 2 assignments # 2 assignments
# 3 simulation movements
# 3 sale packing list / line
# 2 sale trade condition
# 1 software installation # 1 software installation
# 2 software instance # 2 software instance
# 1 software product # 1 software product
# 3 subscription request # 3 subscription request
self.assertRelatedObjectCount(project, 23) self.assertRelatedObjectCount(project, 29)
self.checkERP5StateBeforeExit() self.checkERP5StateBeforeExit()
......
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