"""This module holds the utils of the ``likes`` app."""

from mtp.apps.likes.models import Likeable


def check_likeability(obj):
    """Check the provided object is a likeable object.

    Parameters
    ----------
    obj : object
        The object which will be tested.

    Raises
    ------
    ValueError
        If the provided object isn't a likeable object.

    """

    if not isinstance(obj, Likeable):
        raise ValueError("%s isn't a likeable object." % obj)
