44import base64
55import uuid
66import six
7- from future .backports .urllib .parse import parse_qs
8- from future .backports .urllib .parse import urlencode
9- from future .backports .urllib .parse import urlparse
7+ from six .moves .urllib import parse
108from pytest import raises
119
1210from saml2 .argtree import add_path
@@ -1378,7 +1376,7 @@ def test_signed_redirect(self):
13781376 relay_state = "relay2" , sign = True , sigalg = SIG_RSA_SHA256 )
13791377
13801378 loc = info ["headers" ][0 ][1 ]
1381- qs = parse_qs (loc [1 :])
1379+ qs = parse . parse_qs (loc [1 :])
13821380 assert _leq (qs .keys (),
13831381 ['SigAlg' , 'SAMLRequest' , 'RelayState' , 'Signature' ])
13841382
@@ -1417,8 +1415,8 @@ def test_do_logout_signed_redirect(self):
14171415 assert binding == BINDING_HTTP_REDIRECT
14181416
14191417 loc = info ["headers" ][0 ][1 ]
1420- _ , _ , _ , _ , qs , _ = urlparse (loc )
1421- qs = parse_qs (qs )
1418+ _ , _ , _ , _ , qs , _ = parse . urlparse (loc )
1419+ qs = parse . parse_qs (qs )
14221420 assert _leq (qs .keys (),
14231421 ['SigAlg' , 'SAMLRequest' , 'RelayState' , 'Signature' ])
14241422
@@ -2940,7 +2938,7 @@ def test_signed_redirect(self):
29402938 relay_state = "relay2" , sign = True , sigalg = SIG_RSA_SHA256 )
29412939
29422940 loc = info ["headers" ][0 ][1 ]
2943- qs = parse_qs (loc [1 :])
2941+ qs = parse . parse_qs (loc [1 :])
29442942 assert _leq (qs .keys (),
29452943 ['SigAlg' , 'SAMLRequest' , 'RelayState' , 'Signature' ])
29462944
@@ -2979,8 +2977,8 @@ def test_do_logout_signed_redirect(self):
29792977 assert binding == BINDING_HTTP_REDIRECT
29802978
29812979 loc = info ["headers" ][0 ][1 ]
2982- _ , _ , _ , _ , qs , _ = urlparse (loc )
2983- qs = parse_qs (qs )
2980+ _ , _ , _ , _ , qs , _ = parse . urlparse (loc )
2981+ qs = parse . parse_qs (qs )
29842982 assert _leq (qs .keys (),
29852983 ['SigAlg' , 'SAMLRequest' , 'RelayState' , 'Signature' ])
29862984
@@ -3076,8 +3074,8 @@ def test_do_authn(self):
30763074 assert http_args ["headers" ][0 ][0 ] == "Location"
30773075 assert http_args ["data" ] == []
30783076 redirect_url = http_args ["headers" ][0 ][1 ]
3079- _ , _ , _ , _ , qs , _ = urlparse (redirect_url )
3080- qs_dict = parse_qs (qs )
3077+ _ , _ , _ , _ , qs , _ = parse . urlparse (redirect_url )
3078+ qs_dict = parse . parse_qs (qs )
30813079 req = self .server .parse_authn_request (qs_dict ["SAMLRequest" ][0 ],
30823080 binding )
30833081 resp_args = self .server .response_args (req .message , [response_binding ])
@@ -3097,8 +3095,8 @@ def test_do_negotiated_authn(self):
30973095 assert http_args ["headers" ][0 ][0 ] == "Location"
30983096 assert http_args ["data" ] == []
30993097 redirect_url = http_args ["headers" ][0 ][1 ]
3100- _ , _ , _ , _ , qs , _ = urlparse (redirect_url )
3101- qs_dict = parse_qs (qs )
3098+ _ , _ , _ , _ , qs , _ = parse . urlparse (redirect_url )
3099+ qs_dict = parse . parse_qs (qs )
31023100 req = self .server .parse_authn_request (qs_dict ["SAMLRequest" ][0 ],
31033101 binding )
31043102 resp_args = self .server .response_args (req .message , [response_binding ])
@@ -3152,7 +3150,7 @@ def test_post_sso(self):
31523150 # Here I fake what the client will do
31533151 # create the form post
31543152
3155- http_args ["data" ] = urlencode (_dic )
3153+ http_args ["data" ] = parse . urlencode (_dic )
31563154 http_args ["method" ] = "POST"
31573155 http_args ["dummy" ] = _dic ["SAMLRequest" ]
31583156 http_args ["headers" ] = [('Content-type' ,
@@ -3188,7 +3186,7 @@ def test_negotiated_post_sso(self):
31883186 # Here I fake what the client will do
31893187 # create the form post
31903188
3191- http_args ["data" ] = urlencode (_dic )
3189+ http_args ["data" ] = parse . urlencode (_dic )
31923190 http_args ["method" ] = "POST"
31933191 http_args ["dummy" ] = _dic ["SAMLRequest" ]
31943192 http_args ["headers" ] = [('Content-type' ,
0 commit comments