#NEWLINE# def test_authorization_is_not_granted( self ) : #NEWLINE# #INDENT# self . login ( ) #NEWLINE# response = self . client . get ( ( self . auth_url ( ) + ( '?client_id=%s&response_type=code' % self . get_client ( ) . client_id ) ) ) #NEWLINE# response = self . client . get ( self . auth_url2 ( ) ) #NEWLINE# response = self . client . post ( self . auth_url2 ( ) , { #NEWLINE# #INDENT# 'authorize' : False , #NEWLINE# 'scope' : constants . SCOPES [ 0 ] [ 1 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 302 , response . status_code , response . content ) #NEWLINE# self . assertTrue ( ( self . redirect_url ( ) in response [ 'Location' ] ) ) #NEWLINE# response = self . client . get ( self . redirect_url ( ) ) #NEWLINE# self . assertEqual ( 302 , response . status_code ) #NEWLINE# self . assertTrue ( ( 'error=access_denied' in response [ 'Location' ] ) ) #NEWLINE# self . assertFalse ( ( 'code' in response [ 'Location' ] ) )