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

from mtp.apps.common.tests.test_cases import MTPTestCase

from .likeable_testapp.models import Comment, Proposition


class BaseLikeTestCase(MTPTestCase):
    """Base test case to test likes app."""

    @classmethod
    def setUpTestData(cls):
        """Create some tests data."""

        super().setUpTestData()

        cls.trainee1, cls.trainee2, cls.trainee3 = cls.trainees

        cls.proposition1 = Proposition.objects.create(text="proposition1")
        cls.proposition2 = Proposition.objects.create(text="proposition2")

        cls.comment1 = Comment.objects.create(text="comment1")

        cls.trainee1.like(cls.proposition1)
        cls.trainee1.like(cls.proposition2, 5)

        cls.trainee2.like(cls.proposition2, 2)

        cls.trainee3.like(cls.proposition1, 5)
        cls.trainee3.like(cls.proposition2, -1)
