Allow to run pep8/docs tox env with horizon plugins

As of now, when horizon plugins are configured in the horizon repo,
pep8 and docs tox env cannot run.
This is because openstack_dashboard.settings tries to load horizon plugins
but horizon plugins are not installed in tox env by default and
the jobs will fail as a result.
This commit changes to use openstack_dashboard.test.settings
as DJANGO_SETTINGS_MODULE for these tox environments by default.

Change-Id: I6a9d0c74271cc4addd8a0964b5955d7d3b6d8267
This commit is contained in:
Akihiro Motoki 2018-12-23 02:31:32 +09:00
parent 06ab7a5047
commit 25b6706f50
2 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,8 @@ ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
sys.path.insert(0, ROOT)
# This is required for ReadTheDocs.org, but isn't a bad idea anyway.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'openstack_dashboard.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'openstack_dashboard.test.settings')
django.setup()

View File

@ -56,6 +56,9 @@ basepython = python3
deps =
{[testenv]deps}
-r{toxinidir}/doc/requirements.txt
setenv =
{[testenv]setenv}
DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
commands =
flake8 {posargs}
{envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only