This commit is contained in:
Waylon Walker 2023-05-22 08:28:00 -05:00
parent 3772d7b023
commit 99908c6a5a
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
2 changed files with 22 additions and 8 deletions

View file

@ -0,0 +1,16 @@
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()