Commit 63dee9f1 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_*: Rename add deposit payment script

   Entity is more accurate since it could be used on B2B context later.
parent 5e1d2305
......@@ -54,7 +54,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Person_addDepositPayment</string> </value>
<value> <string>Entity_addDepositPayment</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -34,7 +34,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
self.assertEqual(subscription_request.getSimulationState(), "submitted")
with PinnedDateTime(self, DateTime('2021/04/04')):
payment_transaction = owner_person.Person_addDepositPayment(99*10, currency.getRelativeUrl())
payment_transaction = owner_person.Entity_addDepositPayment(99*10, currency.getRelativeUrl())
# payzen interface will only stop the payment
payment_transaction.stop()
self.tic()
......@@ -209,7 +209,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
# Add deposit
with PinnedDateTime(self, creation_date + 2):
for person in person_list:
payment_transaction = person.Person_addDepositPayment(99*100, currency.getRelativeUrl())
payment_transaction = person.Entity_addDepositPayment(99*100, currency.getRelativeUrl())
# payzen interface will only stop the payment
payment_transaction.stop()
......@@ -311,7 +311,7 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
##################################################
# Add deposit (0.1 to prevent discount generation)
with PinnedDateTime(self, creation_date + 0.1):
payment_transaction = owner_person.Person_addDepositPayment(99*100, currency.getRelativeUrl())
payment_transaction = owner_person.Entity_addDepositPayment(99*100, currency.getRelativeUrl())
# payzen interface will only stop the payment
payment_transaction.stop()
......
......@@ -680,7 +680,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
# Action to submit project subscription
def wrapWithShadow(_person, *arg):
return _person.Person_addDepositPayment(*arg)
return _person.Entity_addDepositPayment(*arg)
payment_transaction = person.Person_restrictMethodAsShadowUser(
shadow_document=person,
callable_object=wrapWithShadow,
......
......@@ -56,7 +56,7 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
##################################################
# Add deposit
with PinnedDateTime(self, creation_date):
payment_transaction = owner_person.Person_addDepositPayment(99*100, currency.getRelativeUrl())
payment_transaction = owner_person.Entity_addDepositPayment(99*100, currency.getRelativeUrl())
# payzen interface will only stop the payment
payment_transaction.stop()
......
......@@ -481,7 +481,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# Action to submit project subscription
def wrapWithShadow(person, *arg):
return person.Person_addDepositPayment(*arg)
return person.Entity_addDepositPayment(*arg)
payment_transaction = owner_person.Person_restrictMethodAsShadowUser(
shadow_document=owner_person,
callable_object=wrapWithShadow,
......@@ -561,7 +561,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
self.login()
project = self.portal.restrictedTraverse(project_relative_url)
payment_transaction = customer_section_organisation.Person_addDepositPayment(99*10, currency.getRelativeUrl())
payment_transaction = customer_section_organisation.Entity_addDepositPayment(99*10, currency.getRelativeUrl())
# payzen interface will only stop the payment
payment_transaction.stop()
self.tic()
......@@ -865,7 +865,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
self.assertEqual(amount, deposit_amount)
def wrapWithShadow(_person, *arg):
return _person.Person_addDepositPayment(*arg)
return _person.Entity_addDepositPayment(*arg)
payment_transaction = project_owner_person.Person_restrictMethodAsShadowUser(
shadow_document=project_owner_person,
callable_object=wrapWithShadow,
......
......@@ -5,7 +5,7 @@ if currency_reference:
currency_value = portal.portal_catalog.getResultValue(
portal_type="Currency",
reference=currency_reference,
validation_state="validated")
validation_state=("validated", "published"))
if currency_value is None:
raise ValueError("Unknown Currency: %s" % currency_reference)
......@@ -18,7 +18,7 @@ if 0 >= deposit_price:
raise ValueError("Nothing to pay")
def wrapWithShadow(entity, total_amount, currency_value, payment_mode):
return entity.Person_addDepositPayment(
return entity.Entity_addDepositPayment(
total_amount,
currency_value.getRelativeUrl(),
payment_mode=payment_mode
......
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