#* Foundation, Inc., *
#* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
#***************************************************************************/
-"""Define the data which must be initially in the database"""
+"""Create fake email accounts in the database for testing purpose"""
from __future__ import unicode_literals
+from django.core.management.base import BaseCommand
+from ... import factories, models
-# XXX TODO Find a Django-way to do this
-AccountType...
+
+class Command(BaseCommand):
+ help = "Create fake email accounts in the database"
+
+ def handle(self, *args, **options):
+ # Remove every account from the database
+ models.Account.objects.all().delete()
+
+ # Create several accounts
+ for i in range(20):
+ account = factories.AccountFactory.create()