#NEWLINE# def test_authorization_requires_a_valid_scope( self ) : #NEWLINE# #INDENT# self . login ( ) #NEWLINE# response = self . client . get ( ( self . auth_url ( ) + ( '?client_id=%s&response_type=code&scope=invalid+invalid2' % self . get_client ( ) . client_id ) ) ) #NEWLINE# response = self . client . get ( self . auth_url2 ( ) ) #NEWLINE# self . assertEqual ( 400 , self . status_code ) #NEWLINE# self . assertTrue ( ( escape ( "'invalid' is not a valid scope." ) in response . content ) ) #NEWLINE# response = self . client . get ( ( self . auth_url ( ) + ( '?client_id=%s&response_type=code&scope=%s' % ( self . get_client ( ) . client_id , constants . SCOPES [ 0 ] [ 1 ] ) ) ) ) #NEWLINE# response = self . client . get ( self . auth_url2 ( ) ) #NEWLINE# self . assertEqual ( 200 , response . status_code )