Commit 5f3f8879 authored by Jérome Perrin's avatar Jérome Perrin

wechat_secure_payment: mock portal.absolute_url to fix test

This tests had a test instance URL hardcoded and was working only on
this instance.
parent 39baa778
Pipeline #7260 passed with stage
in 0 seconds
...@@ -112,8 +112,9 @@ class TestERP5WechatSecurePayment(TestERP5WechatSecurePaymentMixin): ...@@ -112,8 +112,9 @@ class TestERP5WechatSecurePayment(TestERP5WechatSecurePaymentMixin):
wechat_mode='PRODUCTION', wechat_mode='PRODUCTION',
) )
with mock.patch.object( with mock.patch.object(
self.service, 'callWechatApi', return_value={"result_code": 'SUCCESS', "code_url": 'http://somecodeurl'}): self.service, 'callWechatApi', return_value={"result_code": 'SUCCESS', "code_url": 'http://somecodeurl'}),\
mock.patch.object(self.portal, 'absolute_url', return_value='https://erp5.example.com'):
result = self.service.navigate({"out_trade_no": '1234', "total_fee": '5000'}) result = self.service.navigate({"out_trade_no": '1234', "total_fee": '5000'})
self.assertEqual(result, "https://softinst109876.host.vifib.net/erp5/#wechat_payment?trade_no=1234&price=5000&payment_url=http://somecodeurl") self.assertEqual(result, "https://erp5.example.com/#wechat_payment?trade_no=1234&price=5000&payment_url=http://somecodeurl")
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