def is_auto_field(field):
    """
    Test if a given field is an Auto-Field.

    :param DjangoField field: A reference to the given field.
    :rtype: boolean
    :returns:
        A boolean value that's true only if the given field is an Auto-Field.
    """
    return field.name == 'id' or hasattr(field, 'get_internal_type'
        ) and field.get_internal_type() == 'AutoField'
