Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix python 3.x compatibility in tests
Artur Smętf8fc207644c8
diff --git a/tests/test_userprofile.py b/tests/test_userprofile.pyindex 2a39589c84..f368ccb5ce 100644--- a/tests/test_userprofile.py+++ b/tests/test_userprofile.py@@ -1,7 +1,12 @@# encoding: utf-8from __future__ import unicode_literals-import urllib+try:+ # Python 3+ from urllib.parse import urlencode+except ImportError:+ # Python 2+ from urllib import urlencodeimport i18naddressimport pytest@@ -82,7 +87,7 @@ def test_get_address_form(form_data, form_valid, expected_preview, expected_coun'last_name': 'Doe','country': 'PL'}data.update(form_data)- query_dict = urllib.urlencode(data)+ query_dict = urlencode(data)form, preview = forms.get_address_form(data=QueryDict(query_dict), country_code=data['country'])assert preview is expected_preview