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

from mtp.apps.likes.utils import check_likeability

from .tests_cases import BaseLikeTestCase


class UtilsTestCase(BaseLikeTestCase):
    """Test case that tests the utils functions."""

    def test_check_likeability(self):
        """Test the ``check_likeability`` function."""

        # This call should pass with a ``Proposition`` instance
        # because ``Proposition`` class is ``Likeable``
        check_likeability(self.proposition1)

        # This call shouldn't pass with a ``Comment`` instance
        # because ``Comment`` class isn't ``Likeable``
        with self.assertRaises(ValueError):
            check_likeability(self.comment1)
