17 lines
474 B
Python
17 lines
474 B
Python
import random
|
|
|
|
import factory
|
|
|
|
from books.factories import ModuleFactory
|
|
from .models import Assignment
|
|
|
|
from core.factories import fake
|
|
|
|
class AssignmentFactory(factory.django.DjangoModelFactory):
|
|
class Meta:
|
|
model = Assignment
|
|
|
|
title = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(4, 8)))
|
|
assignment = factory.LazyAttribute(lambda x: fake.sentence(nb_words=random.randint(4, 8)))
|
|
module = factory.SubFactory(ModuleFactory)
|