def _SendAuthRequest(tester, url, http_method, user_cookie=None, request_dict=None, allow_errors=None):
 headers = {'Content-Type': 'application/json', 'Content-Encoding': 'gzip'}
 if (user_cookie is not None):
  headers['Cookie'] = ('user=%s' % user_cookie)
 headers['X-Xsrftoken'] = 'fake_xsrf'
 headers['Cookie'] = ((headers['Cookie'] + ';_xsrf=fake_xsrf') if headers.has_key('Cookie') else '_xsrf=fake_xsrf')
 with mock.patch.object(FetchContactsOperation, '_SKIP_UPDATE_FOR_TEST', True):
  response = tester._RunAsync(tester.http_client.fetch, url, method=http_method, body=(None if (request_dict is None) else GzipEncode(json.dumps(request_dict))), headers=headers, follow_redirects=False)
 if (response.code >= 400):
  if ((allow_errors is None) or (response.code not in allow_errors)):
   response.rethrow()
 return response

def _SendAuthRequest ( tester , url , http_method , user_cookie = None , request_dict = None , allow_errors = None ) : headers = { 'Content-Type' : 'application/json' , 'Content-Encoding' : 'gzip' } if ( user_cookie is not None ) : headers [ 'Cookie' ] = ( 'user=%s' % user_cookie ) headers [ 'X-Xsrftoken' ] = 'fake_xsrf' headers [ 'Cookie' ] = ( ( headers [ 'Cookie' ] + ';_xsrf=fake_xsrf' ) if headers . has_key ( 'Cookie' ) else '_xsrf=fake_xsrf' ) with mock . patch . object ( FetchContactsOperation , '_SKIP_UPDATE_FOR_TEST' , True ) : response = tester . _RunAsync ( tester . http_client . fetch , url , method = http_method , body = ( None if ( request_dict is None ) else GzipEncode ( json . dumps ( request_dict ) ) ) , headers = headers , follow_redirects = False ) if ( response . code >= 400 ) : if ( ( allow_errors is None ) or ( response . code not in allow_errors ) ) : response . rethrow ( ) return response
sends request to auth service .