diff options
author | Ib Lundgren <ib.lundgren@gmail.com> | 2013-02-18 19:00:22 +0100 |
---|---|---|
committer | Ib Lundgren <ib.lundgren@gmail.com> | 2013-02-18 19:00:22 +0100 |
commit | 126167b5a4a74072270c8b0a40d8e5f54c0b5f3f (patch) | |
tree | 1ed5b5ce024b622617001f21173bfec2f44f287b | |
parent | 8c6fd8d8b7ae7746eea3966db472763ef01c283f (diff) | |
download | oauthlib-126167b5a4a74072270c8b0a40d8e5f54c0b5f3f.tar.gz |
Python 3 import fix.
-rw-r--r-- | tests/oauth2/draft25/test_servers.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/oauth2/draft25/test_servers.py b/tests/oauth2/draft25/test_servers.py index f235090..633cef1 100644 --- a/tests/oauth2/draft25/test_servers.py +++ b/tests/oauth2/draft25/test_servers.py @@ -7,7 +7,10 @@ ensure consistency in both behaviour and provided interfaces. from __future__ import absolute_import, unicode_literals import json import mock -from urlparse import urlparse, parse_qs +try: + import urlparse +except ImportError: + import urllib.parse as urlparse from ...unittest import TestCase from oauthlib.oauth2 import RequestValidator @@ -16,11 +19,11 @@ from oauthlib.oauth2 import LegacyApplicationServer, BackendApplicationServer def get_query_credentials(uri): - return parse_qs(urlparse(uri).query) + return urlparse.parse_qs(urlparse.urlparse(uri).query) def get_fragment_credentials(uri): - return parse_qs(urlparse(uri).fragment) + return urlparse.parse_qs(urlparse.urlparse(uri).fragment) class TestScopeHandling(TestCase): |