# Path: core/models.py
# def create_auth_token(sender, instance=None, created=False, **kwargs):
# def validate_cron(value):
#     def __init__(self, *args, **kwargs):
#     def formfield(self, **kwargs):
#     def validate(self, value, model_instance):
#     def get_actual_hosts(self) -> models.QuerySet:
#     def get_playbook_name(self) -> str:
#     def get_hosts_without_groups(self) -> models.QuerySet:
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def get_vars(self):
#     def __str__(self):
#     def __str__(self):
#     def create_task(self, user, is_automatically_created=False, repeat_number=0):
#     def have_uncompleted_task(self):
#     def __str__(self):
#     def get_ansible_command(self):
#     def get_duration(self) -> datetime.timedelta:
#     def stop(self):
#     def __str__(self):
# class CronField(models.CharField):
# class TaskOperationsMixin:
# class Variable(models.Model):
#     class Meta:
# class HostGroup(models.Model):
#     class Meta:
# class Host(models.Model):
#     class Meta:
# class AnsibleUser(models.Model):
#     class Meta:
# class TaskTemplate(TaskOperationsMixin, models.Model):
#     class Meta:
# class RepeatSetting(models.Model):
# class Task(TaskOperationsMixin, models.Model):
#     class Meta:
# class TaskLog(models.Model):
#     class Meta:


from django.contrib.auth.models import User
from django.test import TestCase
from core import models
        )

    def test_str(self):
        ansible_user = models.AnsibleUser.objects.get(name='qwer')

        self.assertEqual(str(ansible_user), 'qwer')


class ModelTaskTemplate(TestCase):

    def setUp(self):
        models.TaskTemplate.objects.create(
            name='qwer',
            playbook='/home/',
        )

    def test_str(self):
        task_template = models.TaskTemplate.objects.get(name='qwer')

        self.assertEqual(str(task_template), 'qwer')

    def test_create_task(self):
        task_template = models.TaskTemplate.objects.get(name='qwer')
        self.user = User.objects.create(
            username='Serega',
            password='passwd'
        )
        answer = task_template.create_task(self.user)

        self.assertEqual(models.Task.objects.all().count(), 1)

# Path: core/models.py
# def create_auth_token(sender, instance=None, created=False, **kwargs):
# def validate_cron(value):
#     def __init__(self, *args, **kwargs):
#     def formfield(self, **kwargs):
#     def validate(self, value, model_instance):
#     def get_actual_hosts(self) -> models.QuerySet:
#     def get_playbook_name(self) -> str:
#     def get_hosts_without_groups(self) -> models.QuerySet:
#     def __str__(self):
#     def __str__(self):
#     def __str__(self):
#     def get_vars(self):
#     def __str__(self):
#     def __str__(self):
#     def create_task(self, user, is_automatically_created=False, repeat_number=0):
#     def have_uncompleted_task(self):
#     def __str__(self):
#     def get_ansible_command(self):
#     def get_duration(self) -> datetime.timedelta:
#     def stop(self):
#     def __str__(self):
# class CronField(models.CharField):
# class TaskOperationsMixin:
# class Variable(models.Model):
#     class Meta:
# class HostGroup(models.Model):
#     class Meta:
# class Host(models.Model):
#     class Meta:
# class AnsibleUser(models.Model):
#     class Meta:
# class TaskTemplate(TaskOperationsMixin, models.Model):
#     class Meta:
# class RepeatSetting(models.Model):
# class Task(TaskOperationsMixin, models.Model):
#     class Meta:
# class TaskLog(models.Model):
#     class Meta:


# Path: core/tests/test_models.py
from django.contrib.auth.models import User
from django.test import TestCase
from core import models

        )

    def test_str(self):
        ansible_user = models.AnsibleUser.objects.get(name='qwer')

        self.assertEqual(str(ansible_user), 'qwer')


class ModelTaskTemplate(TestCase):

    def setUp(self):
        models.TaskTemplate.objects.create(
            name='qwer',
            playbook='/home/',
        )

    def test_str(self):
        task_template = models.TaskTemplate.objects.get(name='qwer')

        self.assertEqual(str(task_template), 'qwer')

    def test_create_task(self):
        task_template = models.TaskTemplate.objects.get(name='qwer')
        self.user = User.objects.create(
            username='Serega',
            password='passwd'
        )
        answer = task_template.create_task(self.user)

        self.assertEqual(models.Task.objects.all().count(), 1)

        self.assertEqual(models.Task.objects.get(template=task_template).playbook, '/home/')