Skip to content

Commit

Permalink
Explain the order of where pytest-django finds DJANGO_SETTINGS_MODULE
Browse files Browse the repository at this point in the history
This was changed before the 2.9.0 release and was not documented. The
change is backward incompatible and may surprise users.

Then change was originally made in #199.
  • Loading branch information
pelme committed Oct 5, 2015
1 parent 26c8aa8 commit 726a63f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ Compatibility
* Drop support for Django 1.3. While pytest-django supports a wide range of
Django versions, extended for Django 1.3 was dropped in february 2013.

* Settings defined in `pytest.ini`/`tox.ini`/`setup.cfg` used to override
`DJANGO_SETTINGS_MODULE` defined in the environment. Previously the order was
undocmented. Now, instead the settings from the environment will be used
instead. If you previously relied on overriding the enviornment variable, you
can instead specify `addopts = --ds=yourtestsettings` in the ini-file which
will use the test settings. See `PR #199
<https://github.com/pytest-dev/pytest-django/pull/199>`_.

2.8.0
-----

Expand Down
6 changes: 6 additions & 0 deletions docs/configuring_django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Example contents of pytest.ini::
[pytest]
DJANGO_SETTINGS_MODULE = test_settings

Order of choosing settings
--------------------------

If `--ds`, the environment variable and the pytest.ini configuration is used at
the same time, pytest-django will first prefer using settings from the command
line option `--ds`, then the environment variable and last the pytest.ini.

Using django-configurations
---------------------------
Expand Down

0 comments on commit 726a63f

Please sign in to comment.