"""Base test cases for testing metaplans."""

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

from ..factories import MetaplanFactory


class BaseMetaplanTestCase:
    """Base test case to tests metaplan.

    It provides some default test data useful in a lot of tests.

    Attributes
    ----------
    metaplan: ``mtp.apps.metaplans.models.Metaplan``
        A metaplan instance

    """

    @classmethod
    def setUpTestData(cls):
        """Create some data to use in metaplan tests."""

        super().setUpTestData()

        cls.metaplan = MetaplanFactory(
            session=cls.training_session
        )


class MetaplanTestCase(BaseMetaplanTestCase, MTPTestCase):
    """A test case based on ``BaseMetaplanTestCase`` and ``MTPTestCase``.

    Should be used in most cases.

    """
