Commit 7c0ce5f8 authored by Romain Courteaud's avatar Romain Courteaud

slapos_erp5: test: scenario for money deposit

parent 5c671166
......@@ -363,6 +363,45 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
assert last_message is None, last_message
def test_deposit_with_accounting_scenario(self):
self.portal.testromain()
currency, _, _, _ = self.bootstrapVirtualMasterTest()
self.logout()
# lets join as slapos administrator, which will own few compute_nodes
owner_reference = 'owner-%s' % self.generateNewId()
self.joinSlapOS(self.web_site, owner_reference)
self.login()
owner_person = self.portal.portal_catalog.getResultValue(
portal_type="ERP5 Login",
reference=owner_reference).getParentValue()
self.tic()
# hooray
self.logout()
self.login(owner_person.getUserId())
# XXX XXX do reservation payment for a huge amount, to check if other services are ok
total_price = 1234
# Action to submit project subscription
def wrapWithShadow(person, *arg):
return person.Person_addDepositPayment(*arg)
payment_transaction = owner_person.Person_restrictMethodAsShadowUser(
shadow_document=owner_person,
callable_object=wrapWithShadow,
argument_list=[owner_person, total_price, currency.getRelativeUrl(), 1])
self.tic()
self.logout()
self.login()
payment_transaction.PaymentTransaction_acceptDepositPayment()
self.tic()
assert payment_transaction is not None
assert payment_transaction.receivable.getGroupingReference(None) is not None
def test_virtual_master_with_accounting_scenario(self):
currency, _, _, sale_person = self.bootstrapVirtualMasterTest()
......
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