[FIX] payment_stripe: running tests with python 3.7

mock.call_args only provides the args/kwargs feature in 3.8+

closes odoo/odoo#90716

Related: odoo/enterprise#27253
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit is contained in:
Victor Feyens
2022-05-31 19:17:20 +02:00
parent 987b0d49f9
commit 5e93a231c2
+7 -2
View File
@@ -1,5 +1,6 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import sys
from unittest.mock import patch
from odoo.tests import tagged
@@ -153,5 +154,9 @@ class StripeTest(StripeCommon, PaymentHttpCommon):
return_value={'url': 'https://dummy.url'},
) as mock:
self.stripe._stripe_create_account_link('dummy', 'dummy')
for payload_param in ('account', 'return_url', 'refresh_url', 'type'):
self.assertIn(payload_param, mock.call_args.kwargs['payload'].keys())
mock.assert_called_once()
if sys.version_info >= (3, 8):
# call_args.kwargs is only available in python 3.8+
call_args = mock.call_args.kwargs['payload'].keys()
for payload_param in ('account', 'return_url', 'refresh_url', 'type'):
self.assertIn(payload_param, call_args)