31 lines
708 B
Python
31 lines
708 B
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
# ITerativ GmbH
|
|
# http://www.iterativ.ch/
|
|
#
|
|
# Copyright (c) 2019 ITerativ GmbH. All rights reserved.
|
|
#
|
|
# Created on 2019-10-08
|
|
# @author: chrigu <christian.cueni@iterativ.ch>
|
|
import random
|
|
|
|
import factory
|
|
|
|
from registration.models import LicenseType, License
|
|
|
|
|
|
class LicenseTypeFactory(factory.django.DjangoModelFactory):
|
|
class Meta:
|
|
model = LicenseType
|
|
|
|
name = factory.Sequence(lambda n: 'license-{}'.format(n))
|
|
active = True
|
|
key = factory.Sequence(lambda n: "license-key-%03d" % n)
|
|
description = factory.Sequence(lambda n: "Some description %03d" % n)
|
|
|
|
|
|
class LicenseFactory(factory.django.DjangoModelFactory):
|
|
class Meta:
|
|
model = License
|
|
|