mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02: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()
|
||||
|
||||
@@ -14,10 +14,12 @@ setenv =
|
||||
|
||||
[testenv:serve]
|
||||
changedir=test_project
|
||||
whitelist_externals =
|
||||
rm
|
||||
commands =
|
||||
rm -f modoboa_test.db
|
||||
python manage.py migrate --no-input
|
||||
python manage.py load_initial_data
|
||||
python -c "import django; django.setup(); from modoboa.admin.factories import populate_database; populate_database()"
|
||||
python manage.py load_initial_data --extra-fixtures
|
||||
python manage.py runserver
|
||||
setenv =
|
||||
DJANGO_SETTINGS_MODULE=test_project.settings
|
||||
|
||||
Reference in New Issue
Block a user