2014-10-11 03:54:24 +00:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
|
|
|
|
|
from fobi.tests.helpers import (
|
2016-10-20 22:19:59 +00:00
|
|
|
get_or_create_admin_user,
|
|
|
|
|
create_form_with_entries
|
2014-10-11 03:54:24 +00:00
|
|
|
)
|
|
|
|
|
|
2016-10-20 22:19:59 +00:00
|
|
|
__all__ = ('Command',)
|
|
|
|
|
|
|
|
|
|
|
2014-10-11 03:54:24 +00:00
|
|
|
class Command(BaseCommand):
|
2016-10-20 22:19:59 +00:00
|
|
|
"""Creates test data to fill the dashboard with."""
|
|
|
|
|
|
2014-10-11 03:54:24 +00:00
|
|
|
def handle(self, *args, **options):
|
2016-10-20 22:19:59 +00:00
|
|
|
"""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)
|
2016-10-20 22:19:59 +00:00
|
|
|
except Exception as err:
|
2014-10-11 03:54:24 +00:00
|
|
|
pass
|