def has_units(qty, units):
    """
    Test quantity (`qty`) for compatibility with given `units`.

    .. note::
        The following two expressions are equivalent:

            1. ``chemtk.units.has_units(qty, units)``
            2. ``qty.has_units(units)``

    Parameters
    ----------
    qty : :class:`Quantity` or NoneType
        Specify the quantity to test
    units : str or :class:`Quantity`
        Describe the units `qty` must be convertible to

    Returns
    -------
    is_compatible : bool
        True if and only if the units of `qty` can be converted to `units`.
    """
    return qty.has_units(units)
