factories.py
489 Bytes
import factory
from factory import SubFactory, faker, django
from organismo.models import Organismo, Dependencia
class OrganimsoFactory(django.DjangoModelFactory):
class Meta:
model = Organismo
short_name = faker.Faker(provider='sentence', nb_words=30)
class DependenciaFactory(django.DjangoModelFactory):
class Meta:
model = Dependencia
organismo = SubFactory(factory=OrganimsoFactory)
short_name = faker.Faker(provider='sentence', nb_words=30)