def text_in_text(entity, attribute, value):
    """
    Return ``True`` if the provided entity has the string provided in
    ``value`` within its text attribute.
    """
    try:
        return value.lower() in entity.text.lower()
    except (UnicodeDecodeError, TypeError):
        return False
