Makes your Django tests simple and snappy
django-nose provides all the goodness of nose
_ in your Django tests, like:
INSTALLED_APPS
tests/__init__.py
.
This not only saves busy-work but also eliminates the possibility of
accidentally shadowing test classes.nose plugins
_.. _nose: https://nose.readthedocs.io/en/latest/ .. _nose plugins: http://nose-plugins.jottit.com/
It also provides:
django-nose requires nose 1.2.1 or later, and the latest release
_ is
recommended. It follows the Django's support policy
_, supporting:
.. _latest release: https://pypi.python.org/pypi/nose .. _Django's support policy: https://docs.djangoproject.com/en/1.8/internals/release-process/#supported-versions
nose
_ has been in maintenance mode since at least 2015. django-nose
is in
maintenance mode as well, and the sole maintainer is no longer an active user.
See Jazzband.co
_ to learn how django-nose
is maintained and how you can
help. New projects should consider using pytest
, or unittest
with the
Django testing framework
_.
.. _Jazzband.co: https://jazzband.co .. _pytest: https://docs.pytest.org/en/stable/ .. _unittest: https://docs.python.org/3/library/unittest.html .. _Django testing framework: https://docs.djangoproject.com/en/3.1/topics/testing/
You can get django-nose from PyPI with... :
.. code-block:: shell
$ pip install django-nose
The development version can be installed with... :
.. code-block:: shell
$ pip install -e git://github.com/jazzband/django-nose.git#egg=django-nose
Since django-nose extends Django's built-in test command, you should add it to
your INSTALLED_APPS
in settings.py
:
.. code-block:: python
INSTALLED_APPS = (
...
'django_nose',
...
)
Then set TEST_RUNNER
in settings.py
:
.. code-block:: python
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
:Code: https://github.com/jazzband/django-nose :Issues: https://github.com/jazzband/django-nose/issues?state=open :Docs: https://django-nose.readthedocs.io
1.4.7 (2020-08-19)
* Document Django 2.2 support, no changes needed
* Move project to `Jazzband.co <https://jazzband.co>`_
* Fix fixture loading on MySQL
(`issue 307 <https://github.com/jazzband/django-nose/issues/307>`_,
`dlareau <https://github.com/dlareau>`_)
1.4.6 (2018-10-03)
1.4.5 (2017-08-22)
* Add Django 1.11 support
1.4.4 (2016-06-27)
1.4.3 (2015-12-28)
* Add Django 1.9 support
* Support long options without equals signs, such as "--attr selected"
* Support nose plugins using callback options
* Support nose options without default values (jsatt)
* Remove Django from install dependencies, to avoid accidental upgrades
(jsocol, willkg)
* Setting REUSE_DB to an empty value now disables REUSE_DB, instead of
enabling it (wdoekes)
1.4.2 (2015-10-07)
1.4.1 (2015-06-29)
* Fix version number (ezarowny)
* Fix choice options, unbreaking nose-cover (aamirtharaj-rpx, jwhitlock)
* Support 1.8 app loading system (dgladkov)
* Support non-ASCII file names (singingwolfboy)
* Better PEP8'd assertion names (roganov)
1.4 (2015-04-23)
~~~~~~~~~~~~~~~~
* Django 1.8 support (timc3, adepue, jwhitlock)
* Support --testrunner option (st4lk)
* Fix REUSE_DB second run in py3k (edrmp)
1.3 (2014-12-05)
~~~~~~~~~~~~~~~~
* Django 1.6 and 1.7 support (conrado, co3k, Nepherhotep, mbertheau)
* Python 3.3 and 3.4 testing and support (frewsxcv, jsocol)
1.2 (2013-07-23)
~~~~~~~~~~~~~~~~
* Python 3 support (melinath and jonashaag)
* Django 1.5 compat (fabiosantoscode)
1.1 (2012-05-19)
~~~~~~~~~~~~~~~~
* Django TransactionTestCases don't clean up after themselves; they leave
junk in the DB and clean it up only on ``_pre_setup``. Thus, Django makes
sure these tests run last. Now django-nose does, too. This means one fewer
source of failures on existing projects. (Erik Rose)
* Add support for hygienic TransactionTestCases. (Erik Rose)
* Support models that are used only for tests. Just put them in any file
imported in the course of loading tests. No more crazy hacks necessary.
(Erik Rose)
* Make the fixture bundler more conservative, fixing some conceivable
situations in which fixtures would not appear as intended if a
TransactionTestCase found its way into the middle of a bundle. (Erik Rose)
* Fix an error that would surface when using SQLAlchemy with connection
pooling. (Roger Hu)
* Gracefully ignore the new ``--liveserver`` option introduced in Django 1.4;
don't let it through to nose. (Adam DePue)
1.0 (2012-03-12)
~~~~~~~~~~~~~~~~
* New fixture-bundling plugin for avoiding needless fixture setup (Erik Rose)
* Moved FastFixtureTestCase in from test-utils, so now all the
fixture-bundling stuff is in one library. (Erik Rose)
* Added the REUSE_DB setting for faster startup and shutdown. (Erik Rose)
* Fixed a crash when printing options with certain verbosities. (Daniel Abel)
* Broke hard dependency on MySQL. Support PostgreSQL. (Roger Hu)
* Support SQLite, both memory- and disk-based. (Roger Hu and Erik Rose)
* Nail down versions of the package requirements. (Daniel Mizyrycki)
_(Older changes can be found in the full documentation)._