def all_ancestors_are_published(page, language):
    """
    Returns False if any of the ancestors of page (and language) are
    unpublished, otherwise True.
    """
    page = page.parent
    while page:
        if not page.is_published(language):
            return False
        page = page.parent
    return True