summaryrefslogtreecommitdiff
path: root/addons/payment_authorize/tests/test_authorize.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-08-24 13:17:53 +0200
committerChristophe Simonis <chs@odoo.com>2017-08-24 13:17:53 +0200
commit017ee5eab376b4f09beb62812c1cbc682009ed86 (patch)
tree2af185b0604cd8ce9129c39137bbf39d21d7be89 /addons/payment_authorize/tests/test_authorize.py
parent006c16198f7f68c9dc8b895defd013f33008840a (diff)
parent877e7098719195ed2934fc9c3b5c3bd8ad8bab07 (diff)
[MERGE] forward port branch saas-17 up to 877e7098719
Diffstat (limited to 'addons/payment_authorize/tests/test_authorize.py')
-rw-r--r--addons/payment_authorize/tests/test_authorize.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py
index b02d3d81209..59fb401b091 100644
--- a/addons/payment_authorize/tests/test_authorize.py
+++ b/addons/payment_authorize/tests/test_authorize.py
@@ -11,7 +11,7 @@ import odoo
from odoo.addons.payment.models.payment_acquirer import ValidationError
from odoo.addons.payment.tests.common import PaymentAcquirerCommon
from odoo.addons.payment_authorize.controllers.main import AuthorizeController
-from odoo.tools import mute_logger, pycompat
+from odoo.tools import mute_logger
@odoo.tests.common.at_install(True)
@@ -39,7 +39,7 @@ class AuthorizeForm(AuthorizeCommon):
values['x_fp_timestamp'],
values['x_amount'],
]) + '^'
- return hmac.new(str(values['x_trans_key']), data, hashlib.md5).hexdigest()
+ return hmac.new(values['x_trans_key'].encode('utf-8'), data.encode('utf-8'), hashlib.md5).hexdigest()
def test_10_Authorize_form_render(self):
self.assertEqual(self.authorize.environment, 'test', 'test without test environment')
@@ -91,11 +91,11 @@ class AuthorizeForm(AuthorizeCommon):
tree = objectify.fromstring(res)
self.assertEqual(tree.get('action'), 'https://test.authorize.net/gateway/transact.dll', 'Authorize: wrong form POST url')
for el in tree.iterfind('input'):
- values = list(pycompat.values(el.attrib))
+ values = list(el.attrib.values())
if values[1] in ['submit', 'x_fp_hash', 'return_url', 'x_state', 'x_ship_to_state']:
continue
self.assertEqual(
- unicode(values[2], "utf-8"),
+ values[2],
form_values[values[1]],
'Authorize: wrong value for input %s: received %s instead of %s' % (values[1], values[2], form_values[values[1]])
)