[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user