[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>
This commit is contained in:
Sapan Zaveri
2019-07-09 14:36:59 +00:00
committed by RomainLibert
parent 0899a5a0d4
commit b8cfe33838
+2 -2
View File
@@ -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':