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
  # All requests are expected to have xsrf cookie/header.
  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
Map a foreign table with various GRANTs
dataset/ETHPy150Open viewfinderco/viewfinder/backend/www/test/auth_test.py/_SendAuthRequest--crossover with--dataset/ETHPy150Open perseas/Pyrseas/tests/dbobject/test_privs.py/PrivilegeToMapTestCase.test_map_foreign_table