misc: get urlparse from six (#36515)
This commit is contained in:
parent
86a623669a
commit
29d0f9e8eb
|
@ -8,7 +8,6 @@ import os
|
|||
import re
|
||||
import shutil
|
||||
import tarfile
|
||||
import urlparse
|
||||
import time
|
||||
import xml.etree.ElementTree as ET
|
||||
import zipfile
|
||||
|
@ -23,6 +22,7 @@ from webtest import Upload
|
|||
import mock
|
||||
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from quixote import cleanup, get_publisher
|
||||
from quixote.http_request import Upload as QuixoteUpload
|
||||
|
|
|
@ -10,13 +10,14 @@ import hashlib
|
|||
import mock
|
||||
import re
|
||||
import urllib
|
||||
import urlparse
|
||||
import datetime
|
||||
import time
|
||||
import json
|
||||
import sys
|
||||
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from quixote import cleanup, get_publisher
|
||||
from wcs.qommon.http_request import HTTPRequest
|
||||
from wcs.qommon.form import PicklableUpload
|
||||
|
|
|
@ -8,7 +8,6 @@ import time
|
|||
import hashlib
|
||||
import random
|
||||
import urllib
|
||||
import urlparse
|
||||
import xml.etree.ElementTree as ET
|
||||
import zipfile
|
||||
|
||||
|
@ -21,6 +20,8 @@ except ImportError:
|
|||
xlwt = None
|
||||
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from quixote import cleanup, get_publisher
|
||||
from wcs.qommon import ods
|
||||
from wcs.api_utils import sign_url
|
||||
|
|
|
@ -4,9 +4,10 @@ import os
|
|||
import json
|
||||
import sys
|
||||
import shutil
|
||||
import urlparse
|
||||
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from quixote import cleanup
|
||||
from wcs import publisher
|
||||
from wcs.qommon.http_request import HTTPRequest
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import urlparse
|
||||
import base64
|
||||
import json
|
||||
import urllib
|
||||
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from quixote import cleanup, get_session_manager
|
||||
|
||||
from utilities import get_app, create_temporary_pub
|
||||
|
|
|
@ -7,7 +7,6 @@ import hashlib
|
|||
import os
|
||||
import re
|
||||
import time
|
||||
from urlparse import urlparse
|
||||
import zipfile
|
||||
import base64
|
||||
from webtest import Upload, Hidden
|
||||
|
@ -19,6 +18,8 @@ except ImportError:
|
|||
Image = None
|
||||
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from quixote.http_request import Upload as QuixoteUpload
|
||||
from django.utils.encoding import force_text
|
||||
from wcs.qommon.emails import docutils
|
||||
|
@ -2433,7 +2434,7 @@ def test_form_page_session_var_prefill(pub):
|
|||
|
||||
# check it's not set if it's not whitelisted
|
||||
resp = get_app(pub).get('/?session_var_foo=hello')
|
||||
assert urlparse(resp.location).path == '/'
|
||||
assert urlparse.urlparse(resp.location).path == '/'
|
||||
resp = resp.follow()
|
||||
resp = resp.click('test')
|
||||
assert resp.forms[0]['f0'].value == ''
|
||||
|
@ -2444,14 +2445,14 @@ query_string_allowed_vars = foo,bar
|
|||
''')
|
||||
|
||||
resp = get_app(pub).get('/?session_var_foo=hello')
|
||||
assert urlparse(resp.location).path == '/'
|
||||
assert urlparse.urlparse(resp.location).path == '/'
|
||||
resp = resp.follow()
|
||||
resp = resp.click('test')
|
||||
assert resp.forms[0]['f0'].value == 'hello'
|
||||
|
||||
# check it survives a login
|
||||
resp = get_app(pub).get('/?session_var_foo=hello2')
|
||||
assert urlparse(resp.location).path == '/'
|
||||
assert urlparse.urlparse(resp.location).path == '/'
|
||||
resp = resp.follow()
|
||||
resp = resp.click('Login')
|
||||
resp = resp.follow()
|
||||
|
@ -2464,15 +2465,15 @@ query_string_allowed_vars = foo,bar
|
|||
|
||||
# check repeated options are ignored
|
||||
resp = get_app(pub).get('/?session_var_foo=hello&session_var_foo=hello2')
|
||||
assert urlparse(resp.location).path == '/'
|
||||
assert urlparse.urlparse(resp.location).path == '/'
|
||||
resp = resp.follow()
|
||||
resp = resp.click('test')
|
||||
assert resp.forms[0]['f0'].value == ''
|
||||
|
||||
# check extra query string parameters are not lost
|
||||
resp = get_app(pub).get('/?session_var_foo=hello&foo=bar')
|
||||
assert urlparse(resp.location).path == '/'
|
||||
assert urlparse(resp.location).query == 'foo=bar'
|
||||
assert urlparse.urlparse(resp.location).path == '/'
|
||||
assert urlparse.urlparse(resp.location).query == 'foo=bar'
|
||||
|
||||
os.unlink(os.path.join(pub.app_dir, 'site-options.cfg'))
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@ import pytest
|
|||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
import urllib2
|
||||
|
||||
import mock
|
||||
|
||||
from utilities import create_temporary_pub, clean_temporary_pub
|
||||
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from quixote import cleanup
|
||||
|
||||
from wcs.ctl.check_hobos import CmdCheckHobos
|
||||
|
@ -240,7 +240,7 @@ def test_configure_site_options():
|
|||
assert (pub.get_site_option('authentic.example.net', 'wscall-secrets')
|
||||
== CmdCheckHobos.shared_secret(HOBO_JSON['services'][1]['secret_key'],
|
||||
HOBO_JSON['services'][2]['secret_key']))
|
||||
self_domain = urllib2.urlparse.urlsplit(service.get('base_url')).netloc
|
||||
self_domain = urlparse.urlsplit(service.get('base_url')).netloc
|
||||
assert pub.get_site_option(self_domain, 'wscall-secrets') != '0'
|
||||
|
||||
def test_update_configuration():
|
||||
|
|
|
@ -2,7 +2,6 @@ import datetime
|
|||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import urlparse
|
||||
|
||||
try:
|
||||
import lasso
|
||||
|
@ -11,6 +10,7 @@ except ImportError:
|
|||
|
||||
import pytest
|
||||
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from quixote import cleanup
|
||||
from quixote import get_session, get_session_manager
|
||||
from wcs.qommon.http_request import HTTPRequest
|
||||
|
|
|
@ -5,12 +5,12 @@ import pytest
|
|||
import shutil
|
||||
import time
|
||||
import urllib2
|
||||
import urlparse
|
||||
import zipfile
|
||||
|
||||
import mock
|
||||
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
from quixote import cleanup, get_response
|
||||
from wcs.qommon.errors import ConnectionError
|
||||
|
|
|
@ -8,13 +8,13 @@ import pytest
|
|||
import shutil
|
||||
import sys
|
||||
import threading
|
||||
import urlparse
|
||||
|
||||
from wcs import sql, sessions
|
||||
|
||||
from webtest import TestApp
|
||||
from quixote import cleanup, get_publisher
|
||||
from django.conf import settings
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
|
||||
import wcs
|
||||
import wcs.wsgi
|
||||
|
|
|
@ -18,9 +18,9 @@ import datetime
|
|||
import json
|
||||
import sys
|
||||
import time
|
||||
import urlparse
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from quixote import get_publisher, get_response
|
||||
|
||||
from ..qommon import _
|
||||
|
|
Loading…
Reference in New Issue