コード例 #1
0
    def handle(self, *args, **options):
        if options.pop("nuke", False):
            nuke(command_options=options)

        User = get_user_model()
        if issubclass(User, AbstractUser):
            if not User.objects.filter(username="******").exists():
                User.objects.create_superuser(username="******", email="*****@*****.**", password="******")
                print("Admin user 'admin' (password 'admin') created")
            while User.objects.count() < 25:
                user = UserFactory()
                print("Created user %s" % user.pk)
        while Label.objects.count() < 5:
            label = LabelFactory()
            print("Created label %s" % label.pk)
        while Hearing.objects.count() < 10:
            hearing = HearingFactory()
            print("Created hearing %s" % hearing.pk)
コード例 #2
0
ファイル: conftest.py プロジェクト: tomijarvi/kerrokantasi
def random_label():
    return LabelFactory()
コード例 #3
0
ファイル: conftest.py プロジェクト: tomijarvi/kerrokantasi
def random_hearing():
    if not Label.objects.exists():
        LabelFactory()
    return HearingFactory()