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

21 lines
508 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
2014-10-11 03:54:24 +00:00
)
__all__ = ('Command',)
2014-10-11 03:54:24 +00:00
class Command(BaseCommand):
"""Creates test data to fill the dashboard with."""
2014-10-11 03:54:24 +00:00
def handle(self, *args, **options):
"""Handle."""
2014-10-11 03:54:24 +00:00
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 err:
2014-10-11 03:54:24 +00:00
pass