#NEWLINE# def test_should_return_400_with_invalid_request_error_if_base64_header_could_not_be_decoded( ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'grant_type' : 'authorization_code' , #NEWLINE# 'code' : 'ccc' , #NEWLINE# 'redirect_uri' : 'http://callback' , #NEWLINE# #UNINDENT# } #NEWLINE# invalid_headers = { #NEWLINE# #INDENT# 'Content-Type' : CONTENT_TYPE , #NEWLINE# 'Authorization' : 'Basic this-is-not-base-64' , #NEWLINE# #UNINDENT# } #NEWLINE# response = requests . post ( URL , data = data , headers = data ) #NEWLINE# assert_error_response_body ( response , 'invalid_request' , 'Base 64 from Authorization header could not be decoded' )