"""Factories for the ``tasks`` app models"""

import uuid

import factory

from mtp.apps.accounts.factories import MTPUserFactory

from .models import DjangoTask


class DjangoTaskFactory(factory.django.DjangoModelFactory):
    """Factory for the ``DjangoTask`` model

    Attributes
    ----------
    celery_task_id: uuid4
        A fake celery task id, created via ``uuid4``
    user: mtp.apps.accounts.models.MTPUser
        The user tied to the task, created via the ``MTPUserFactory``

    """

    class Meta:
        model = DjangoTask

    celery_task_id = factory.Sequence(lambda n: str(uuid.uuid4()))
    user = factory.SubFactory(MTPUserFactory)
