mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-12-05 12:34:08 +01:00
add --extra-fixtures options to avoid python code in tox.ini
This commit is contained in:
@@ -30,6 +30,10 @@ class Command(BaseCommand):
|
||||
"--admin-username", default="admin",
|
||||
help="Username of the initial super administrator."
|
||||
)
|
||||
parser.add_argument(
|
||||
"--extra-fixtures", action="store_true", default=False,
|
||||
help="Also load some fixtures from the admin application."
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
"""Command entry point."""
|
||||
@@ -70,3 +74,7 @@ class Command(BaseCommand):
|
||||
extension = exts_pool.get_extension(extname)
|
||||
extension.load_initial_data()
|
||||
events.raiseEvent("InitialDataLoaded", extname)
|
||||
|
||||
if options['extra_fixtures']:
|
||||
from modoboa.admin import factories
|
||||
factories.populate_database()
|
||||
|
||||
Reference in New Issue
Block a user