def METHOD_NAME(request, name):
    """
    When we are testing we often can't sign in successfully because
    it involves a callback from the server which will fail. This will
    simulate the process for a user that is already in the DB and
    has a valid token.
    Should only be active in DEBUG mode.
    Input:
      request: django.http.HttpRequest
      name: str: name to start the session for
    Return:
      django.http.HttpResponse based object
    """
    if not settings.DEBUG:
        raise Http404()
    user = get_object_or_404(models.GitUser, name=name)
    if not user.token:
        raise Http404('User %s does not have a token.' % user.name )
    user.server.auth().set_browser_session_from_user(request.session, user)
    messages.info(request, 'Started debug session for user "%s" on %s' % (user.name, user.server.name))
    return redirect('ci:main')