Oprava testovacich dat pro nove Django
This commit is contained in:
parent
f92eeb8450
commit
4819c0fd6a
1 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,7 @@ import datetime
|
|||
import os
|
||||
import random
|
||||
|
||||
from django.core.management.base import NoArgsCommand
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.core.management import call_command
|
||||
from django.conf import settings
|
||||
|
||||
|
@ -14,10 +14,10 @@ import django.contrib.auth
|
|||
User = django.contrib.auth.get_user_model()
|
||||
|
||||
|
||||
class Command(NoArgsCommand):
|
||||
class Command(BaseCommand):
|
||||
help = "Clear database and load testing data."
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
def handle(self, **options):
|
||||
assert settings.DEBUG == True
|
||||
dbfile = settings.DATABASES['default']['NAME']
|
||||
if os.path.exists(dbfile):
|
||||
|
|
Loading…
Reference in a new issue