django-fobi/examples/simple/foo/management/commands/fobi_create_test_data.py
2022-07-12 22:53:28 +02:00

20 lines
509 B
Python

from django.core.management.base import BaseCommand
from fobi.tests.helpers import (
create_form_with_entries,
get_or_create_admin_user,
)
__all__ = ("Command",)
class Command(BaseCommand):
"""Creates test data to fill the dashboard with."""
def handle(self, *args, **options):
"""Handle."""
try:
user = get_or_create_admin_user()
create_form_with_entries(user, create_entries_if_form_exist=False)
except Exception as err:
pass