@@ -317,18 +317,16 @@ def test_id_token_skip_authorization_completely(self):
317317 self .application .skip_authorization = True
318318 self .application .save ()
319319
320- query_string = urlencode ( {
320+ query_data = {
321321 "client_id" : self .application .client_id ,
322322 "response_type" : "id_token" ,
323323 "state" : "random_state_string" ,
324324 "nonce" : "random_nonce_string" ,
325325 "scope" : "openid" ,
326326 "redirect_uri" : "http://example.org" ,
327- })
328-
329- url = "{url}?{qs}" .format (url = reverse ("oauth2_provider:authorize" ), qs = query_string )
327+ }
330328
331- response = self .client .get (url )
329+ response = self .client .get (reverse ( "oauth2_provider:authorize" ), data = query_data )
332330 self .assertEqual (response .status_code , 302 )
333331 self .assertIn ("http://example.org#" , response ["Location" ])
334332 self .assertNotIn ("access_token=" , response ["Location" ])
@@ -351,17 +349,15 @@ def test_id_token_skip_authorization_completely_missing_nonce(self):
351349 self .application .skip_authorization = True
352350 self .application .save ()
353351
354- query_string = urlencode ( {
352+ query_data = {
355353 "client_id" : self .application .client_id ,
356354 "response_type" : "id_token" ,
357355 "state" : "random_state_string" ,
358356 "scope" : "openid" ,
359357 "redirect_uri" : "http://example.org" ,
360- })
361-
362- url = "{url}?{qs}" .format (url = reverse ("oauth2_provider:authorize" ), qs = query_string )
358+ }
363359
364- response = self .client .get (url )
360+ response = self .client .get (reverse ( "oauth2_provider:authorize" ), data = query_data )
365361 self .assertEqual (response .status_code , 302 )
366362 self .assertIn ("error=invalid_request" , response ["Location" ])
367363 self .assertIn ("error_description=Request+is+missing+mandatory+nonce+paramete" , response ["Location" ])
@@ -425,18 +421,16 @@ def test_access_token_and_id_token_skip_authorization_completely(self):
425421 self .application .skip_authorization = True
426422 self .application .save ()
427423
428- query_string = urlencode ( {
424+ query_data = {
429425 "client_id" : self .application .client_id ,
430426 "response_type" : "id_token token" ,
431427 "state" : "random_state_string" ,
432428 "nonce" : "random_nonce_string" ,
433429 "scope" : "openid" ,
434430 "redirect_uri" : "http://example.org" ,
435- })
436-
437- url = "{url}?{qs}" .format (url = reverse ("oauth2_provider:authorize" ), qs = query_string )
431+ }
438432
439- response = self .client .get (url )
433+ response = self .client .get (reverse ( "oauth2_provider:authorize" ), data = query_data )
440434 self .assertEqual (response .status_code , 302 )
441435 self .assertIn ("http://example.org#" , response ["Location" ])
442436 self .assertIn ("access_token=" , response ["Location" ])
0 commit comments