learn-sql-model/learn_sql_model/factories/pet.py
2023-05-22 08:28:32 -05:00

16 lines
386 B
Python

from polyfactory.factories.pydantic_factory import ModelFactory
from learn_sql_model.models.hero import Hero
from learn_sql_model.models.pet import Pet
__relationship__ = [Hero]
class PetFactory(ModelFactory[Pet]):
__model__ = Pet
__set_as_default_factory_for_type__ = True
id = None
@classmethod
def name(cls) -> str:
return cls.__faker__.first_name()