defining_codes product string ascii_uppercase repeat class DefiningFac

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
defining_codes = product(string.ascii_uppercase, repeat=2)
class DefiningFactory(DjangoModelFactory):
matter_type = factory.SubFactory(MatterTypeFactory)
number = 31
code = factory.Sequence(lambda n: "".join(next(defining_codes)))
value = factory.Sequence(lambda n: 'Defining {0}'.format(n))
class Meta:
model = Defining