def METHOD_NAME(
    redirect_mock, reverse_mock, projects_mock, util_mock, get_mock, client
):
    """User is not authenticated and Userprofile.custom_homepage not defined,
    redirect to project dashboard"""
    view = reverse(
        "pontoon.translate.locale.agnostic", kwargs=dict(slug="FOO", part="BAR")
    )
    # mock return value for url reverse
    reverse_mock.return_value = 73
    # mock return value for Project.objects.available
    projects_mock.visible_for().available.return_value = "AVAILABLEPROJECTS"
    # create a mock Project with .locales
    project_mock = MagicMock()
    type(project_mock).locales = PropertyMock(return_value="LOCALES")
    # mock return value for get_object_or_404 for Project
    get_mock.return_value = project_mock
    # mock return value for redirect
    mock_response = HttpResponse()
    redirect_mock.return_value = mock_response
    # mock return_value for get_project_locale_from_request
    util_mock.return_value = None
    response = client.get("%s?foo=bar" % view)
    # Project.objects.visible_for was called with the test user
    assert projects_mock.visible_for.call_args[0][0] == AnonymousUser()
    # Project.objects.available was called with no args
    assert list(projects_mock.visible_for().available.call_args) == [(), {}]
    # get_object_or_404 was called with Project.objects.available and
    # the requested slug
    assert list(get_mock.call_args) == [("AVAILABLEPROJECTS",), {"slug": "FOO"}]
    # get_project_locale_from_request
    assert list(util_mock.call_args) == [(response.wsgi_request, "LOCALES"), {}]
    # reverse was called with args...
    assert list(reverse_mock.call_args) == [
        ("pontoon.projects.project",),
        {"kwargs": {"slug": "FOO"}},
    ]
    # redirect was called with reverse result
    assert list(redirect_mock.call_args) == [("73?foo=bar",), {}]
    assert response is mock_response