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