diff options
| author | Sapan Zaveri <sza@odoo.com> | 2019-06-13 12:42:51 +0000 |
|---|---|---|
| committer | RomainLibert <rli@odoo.com> | 2019-07-09 14:36:59 +0000 |
| commit | b8cfe33838afdf1c7a7dde757ed8044d7767cce2 (patch) | |
| tree | 3c39231aee3eb40338313c434efe62ee83343893 | |
| parent | 0899a5a0d490e1ece55ddf3621c38bd111137a70 (diff) | |
[FIX] payment_alipay: fix the broken alipay tests
Backport of https://github.com/odoo/odoo/pull/34132
The test case of alipay payment is going to failed due to:
1) Now the redirect_url from the return_url is removed in commit :
https://github.com/odoo/odoo/commit/0aefe72b773a21bdd38fdc86779d3030bd5127c6
but it's still it's there in test cases so removed from test case.
2) To make the transaction done it must be in draft, pending or authorised
state but in first test case payment process the transaction state is set to
cancel and in another payment process use the same transaction again to set
it success so before use the same transaction again just set the state to draft.
task- 2005926
closes odoo/odoo#34708
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
| -rw-r--r-- | addons/payment_alipay/tests/test_alipay.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/payment_alipay/tests/test_alipay.py b/addons/payment_alipay/tests/test_alipay.py index b735861b9c2..511231dd8f1 100644 --- a/addons/payment_alipay/tests/test_alipay.py +++ b/addons/payment_alipay/tests/test_alipay.py @@ -41,7 +41,7 @@ class AlipayTest(PaymentAcquirerCommon): 'notify_url': urls.url_join(base_url, AlipayController._notify_url), 'out_trade_no': 'SO12345-1', 'partner': self.alipay.alipay_merchant_partner_id, - 'return_url': urls.url_join(base_url, AlipayController._return_url) + '?' + urls.url_encode({'redirect_url': '/payment/process'}), + 'return_url': urls.url_join(base_url, AlipayController._return_url), 'subject': 'test_ref0', 'total_fee': '0.01', } @@ -152,7 +152,7 @@ class AlipayTest(PaymentAcquirerCommon): self.assertEqual(tx.acquirer_reference, '2017112321001003690200384552', 'alipay: wrong txn_id after receiving a valid pending notification') # update tx - tx.write({'acquirer_reference': False}) + tx.write({'state': 'draft', 'acquirer_reference': False}) # update notification from alipay should not go through since it has already been set as 'done' if self.alipay.alipay_payment_method == 'standard_checkout': |
