django-fobi/examples/simple/foo/management/commands/fobi_create_test_data.py

17 lines
476 B
Python
Raw Normal View History

2014-10-11 03:54:24 +00:00
from django.core.management.base import BaseCommand
from fobi.tests.helpers import (
get_or_create_admin_user, create_form_with_entries
)
class Command(BaseCommand):
def handle(self, *args, **options):
"""
Creates test data to fill the dashboard with.
"""
try:
2014-10-11 12:08:09 +00:00
user = get_or_create_admin_user()
2014-10-11 03:54:24 +00:00
create_form_with_entries(user, create_entries_if_form_exist=False)
except Exception as e:
pass