class TaskStatusFactory factory DjangoModelFactory value factory Seque

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class TaskStatusFactory(factory.DjangoModelFactory):
value = factory.Sequence(lambda n: 'task status {0}'.format(n))
class Meta:
model = TaskStatus
class TaskImportanceFactory(factory.DjangoModelFactory):
value = factory.Sequence(lambda n: 'task importance {0}'.format(n))
class Meta:
model = TaskImportance
class TaskFactory(factory.DjangoModelFactory):
sub_matter = factory.SubFactory(SubMatterFactory)
title = factory.Sequence(lambda n: 'task {0}'.format(n))
assignor = factory.SubFactory(UserFactory)
assignee = factory.SubFactory(UserFactory)
status = factory.SubFactory(TaskStatusFactory)
importance = factory.SubFactory(TaskImportanceFactory)
class Meta:
model = Task