34 lines
726 B
Python
Executable File
34 lines
726 B
Python
Executable File
import factory
|
|
|
|
from outbo.apps.products import models
|
|
from tests.factories.projects import ProjectFactory
|
|
from faker import Factory as FakerFactory
|
|
|
|
faker = FakerFactory.create()
|
|
|
|
|
|
class ProductStageFactory(factory.django.DjangoModelFactory):
|
|
id = ""
|
|
label = ""
|
|
group = 0
|
|
description = ""
|
|
next_action = ""
|
|
order = 0
|
|
|
|
class Meta:
|
|
model = models.ProductStage
|
|
|
|
|
|
class PackagingTypeFactory(factory.django.DjangoModelFactory):
|
|
name = factory.LazyAttribute(lambda x: faker.word())
|
|
|
|
class Meta:
|
|
model = models.PackagingType
|
|
|
|
|
|
class ProductFactory(factory.django.DjangoModelFactory):
|
|
project = factory.SubFactory(ProjectFactory)
|
|
|
|
class Meta:
|
|
model = models.Product
|