Commit c0bde16c authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Pay Now renamed to Unpaid

   Pay Now don't contain the link to pay anymore, so the user
   might use global action to make the payments anyway.

   Return translated 'state' directly and update tests
parent 9985bb44
......@@ -17,7 +17,7 @@ else:
elif context.getTotalPrice() == 0:
result = "Free!"
else:
result = "Pay Now"
result = "Unpaid"
# Search to know if there are some payment waiting for confirmation
payment = portal.portal_catalog.getResultValue(
......@@ -38,4 +38,4 @@ else:
if external_payment_id is not None:
result = "Waiting for payment confirmation"
return result
return context.Base_translateString(result)
......@@ -392,13 +392,13 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
def test_AccountingTransaction_getPaymentState_payzen_unpaid_payment(self):
invoice = self.createStoppedSaleInvoiceTransaction()
# If payment is not indexed or not started the state should be Pay Now
self.assertEqual("Pay Now", invoice.AccountingTransaction_getPaymentState())
# If payment is not indexed or not started the state should be Unpaid
self.assertEqual("Unpaid", invoice.AccountingTransaction_getPaymentState())
def test_AccountingTransaction_getPaymentState_wechat_unpaid_payment(self):
invoice = self.createStoppedSaleInvoiceTransaction(payment_mode='wechat')
# If payment is not indexed or not started the state should be Pay Now
self.assertEqual("Pay Now", invoice.AccountingTransaction_getPaymentState())
# If payment is not indexed or not started the state should be Unpaid
self.assertEqual("Unpaid", invoice.AccountingTransaction_getPaymentState())
def test_AccountingTransaction_getPaymentState_payzen_paynow_payment(self):
project = self.addProject()
......@@ -407,7 +407,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
destination_section_value=person)
self.tic()
self.login(person.getUserId())
self.assertEqual("Pay Now", invoice.AccountingTransaction_getPaymentState())
self.assertEqual("Unpaid", invoice.AccountingTransaction_getPaymentState())
def test_AccountingTransaction_getPaymentState_wechat_paynow_payment(self):
project = self.addProject()
......@@ -417,7 +417,7 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
payment_mode="wechat")
self.tic()
self.login(person.getUserId())
self.assertEqual("Pay Now", invoice.AccountingTransaction_getPaymentState())
self.assertEqual("Unpaid", invoice.AccountingTransaction_getPaymentState())
def test_AccountingTransaction_getPaymentState_payzen_waiting_payment(self):
project = self.addProject()
......
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