summaryrefslogtreecommitdiff
path: root/addons/payment_authorize/tests
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2017-05-11 11:55:22 +0200
committerXavier Morel <xmo@odoo.com>2017-05-15 12:26:30 +0200
commit01e35141479b8dfc4a390518f89fc52e7cec5396 (patch)
tree24ac6661613e8088140eb607e604d44b2ff5ce42 /addons/payment_authorize/tests
parent54df4b36d7c826de3d07f81297aa17f74d8271ea (diff)
[FIX] P3: urllib, urllib2 and urlparse
In Python 3, all of these were "consolidated" under urllib(.request, .parse, .errors) which is inconvenient. Since we already have hard dependencies on requests and werkzeug(.urls, which is a backport of Python 3's unicode-aware urllib.parse) migrate *everything* to that. A sticking point is urllib2.URLError, those were (mostly) replaced by the slightly more general IOError which URLError extends.
Diffstat (limited to 'addons/payment_authorize/tests')
-rw-r--r--addons/payment_authorize/tests/test_authorize.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py
index c16113cd52b..d19690284a8 100644
--- a/addons/payment_authorize/tests/test_authorize.py
+++ b/addons/payment_authorize/tests/test_authorize.py
@@ -3,9 +3,9 @@
import hashlib
import hmac
import time
-import urlparse
import unittest
from lxml import objectify
+from werkzeug import urls
import odoo
from odoo.addons.payment.models.payment_acquirer import ValidationError
@@ -59,8 +59,8 @@ class AuthorizeForm(AuthorizeCommon):
'x_version': '3.1',
'x_relay_response': 'TRUE',
'x_fp_timestamp': str(int(time.time())),
- 'x_relay_url': '%s' % urlparse.urljoin(base_url, AuthorizeController._return_url),
- 'x_cancel_url': '%s' % urlparse.urljoin(base_url, AuthorizeController._cancel_url),
+ 'x_relay_url': urls.url_join(base_url, AuthorizeController._return_url),
+ 'x_cancel_url': urls.url_join(base_url, AuthorizeController._cancel_url),
'return_url': None,
'x_currency_code': 'USD',
'x_invoice_num': 'SO004',