# Path: tests/models.py
# class BreadLabelValueTestModel(models.Model):
#     """Model for testing LabelValueReadView, also for GetVerboseNameTest"""
# 
#     name = models.CharField(max_length=10)
#     banana = models.IntegerField(verbose_name="a yellow fruit", default=0)
# 
#     def name_reversed(self):
#         return self.name[::-1]
# 
# class BreadTestModel(models.Model):
#     name = models.CharField(max_length=10)
#     age = models.IntegerField()
#     other = models.ForeignKey(
#         BreadTestModel2,
#         blank=True,
#         null=True,
#         on_delete=models.CASCADE,
#     )
# 
#     class Meta:
#         ordering = [
#             "name",
#             "-age",  # If same name, sort oldest first
#         ]
#         permissions = [
#             ("browse_breadtestmodel", "can browse BreadTestModel"),
#         ]
# 
#     def __str__(self):
#         return self.name
# 
#     def get_name(self):
#         return self.name
# 
#     def method1(self, arg):
#         # Method that has a required arg
#         pass
# 
#     def method2(self, arg=None):
#         # method that has an optional arg
#         pass
# 
# class BreadTestModel2(models.Model):
#     text = models.CharField(max_length=20)
#     label_model = models.OneToOneField(
#         BreadLabelValueTestModel,
#         null=True,
#         related_name="model2",
#         on_delete=models.CASCADE,
#     )
#     model1 = models.OneToOneField(
#         "BreadTestModel",
#         null=True,
#         related_name="model1",
#         on_delete=models.CASCADE,
#     )
# 
#     def get_text(self):
#         return self.text


import factory
import factory.fuzzy
from .models import BreadLabelValueTestModel, BreadTestModel, BreadTestModel2



class BreadTestModel2Factory(factory.DjangoModelFactory):
    FACTORY_FOR = BreadTestModel2

    text = factory.fuzzy.FuzzyText(length=10)


class BreadTestModelFactory(factory.DjangoModelFactory):
    FACTORY_FOR = BreadTestModel

    name = factory.fuzzy.FuzzyText(length=10)
    age = factory.fuzzy.FuzzyInteger(low=1, high=99)
    other = factory.SubFactory(BreadTestModel2Factory)


class BreadLabelValueTestModelFactory(factory.DjangoModelFactory):

# Path: tests/models.py
# class BreadLabelValueTestModel(models.Model):
#     """Model for testing LabelValueReadView, also for GetVerboseNameTest"""
# 
#     name = models.CharField(max_length=10)
#     banana = models.IntegerField(verbose_name="a yellow fruit", default=0)
# 
#     def name_reversed(self):
#         return self.name[::-1]
# 
# class BreadTestModel(models.Model):
#     name = models.CharField(max_length=10)
#     age = models.IntegerField()
#     other = models.ForeignKey(
#         BreadTestModel2,
#         blank=True,
#         null=True,
#         on_delete=models.CASCADE,
#     )
# 
#     class Meta:
#         ordering = [
#             "name",
#             "-age",  # If same name, sort oldest first
#         ]
#         permissions = [
#             ("browse_breadtestmodel", "can browse BreadTestModel"),
#         ]
# 
#     def __str__(self):
#         return self.name
# 
#     def get_name(self):
#         return self.name
# 
#     def method1(self, arg):
#         # Method that has a required arg
#         pass
# 
#     def method2(self, arg=None):
#         # method that has an optional arg
#         pass
# 
# class BreadTestModel2(models.Model):
#     text = models.CharField(max_length=20)
#     label_model = models.OneToOneField(
#         BreadLabelValueTestModel,
#         null=True,
#         related_name="model2",
#         on_delete=models.CASCADE,
#     )
#     model1 = models.OneToOneField(
#         "BreadTestModel",
#         null=True,
#         related_name="model1",
#         on_delete=models.CASCADE,
#     )
# 
#     def get_text(self):
#         return self.text


# Path: tests/factories.py
import factory
import factory.fuzzy
from .models import BreadLabelValueTestModel, BreadTestModel, BreadTestModel2




class BreadTestModel2Factory(factory.DjangoModelFactory):
    FACTORY_FOR = BreadTestModel2

    text = factory.fuzzy.FuzzyText(length=10)


class BreadTestModelFactory(factory.DjangoModelFactory):
    FACTORY_FOR = BreadTestModel

    name = factory.fuzzy.FuzzyText(length=10)
    age = factory.fuzzy.FuzzyInteger(low=1, high=99)
    other = factory.SubFactory(BreadTestModel2Factory)


class BreadLabelValueTestModelFactory(factory.DjangoModelFactory):

    FACTORY_FOR = BreadLabelValueTestModel