Skip to main content

Makes your Django tests simple and snappy

Project description

django-nose provides all the goodness of nose in your Django tests, like:

  • Testing just your apps by default, not all the standard ones that happen to be in INSTALLED_APPS

  • Running the tests in one or more specific modules (or apps, or classes, or folders, or just running a specific test)

  • Obviating the need to import all your tests into tests/__init__.py. This not only saves busy-work but also eliminates the possibility of accidentally shadowing test classes.

  • Taking advantage of all the useful nose plugins

It also provides:

  • Fixture bundling, an optional feature which speeds up your fixture-based tests by a factor of 4

  • Reuse of previously created test DBs, cutting 10 seconds off startup time

  • Hygienic TransactionTestCases, which can save you a DB flush per test

  • Support for various databases. Tested with MySQL, PostgreSQL, and SQLite. Others should work as well.

django-nose requires nose 1.2.1 or later, and the latest release is recommended. It follows the Django’s support policy, supporting:

  • Django 1.8 (LTS) with Python 2.7, 3.4, or 3.5

  • Django 1.9 with Python 2.7, 3.4, or 3.5

  • Django 1.10 with Python 2.7, 3.4, or 3.5

  • Django 1.11 (LTS) with Python 2.7, 3.4, 3.5, or 3.6

  • Django 2.0 with Python 3.4, 3.5, 3.6, or 3.7

  • Django 2.1 with Python 3.5, 3.6, or 3.7

Installation

You can get django-nose from PyPI with… :

$ pip install django-nose

The development version can be installed with… :

$ pip install -e git://github.com/django-nose/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:

INSTALLED_APPS = (
    ...
    'django_nose',
    ...
)

Then set TEST_RUNNER in settings.py:

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

Development

Code:

https://github.com/django-nose/django-nose

Issues:

https://github.com/django-nose/django-nose/issues?state=open

Docs:

https://django-nose.readthedocs.io

Changelog

1.4.6 (2018-10-03)

  • Document Django 2.0 and 2.1 support, no changes needed

  • Document Python 3.7 support

1.4.5 (2017-08-22)

  • Add Django 1.11 support

1.4.4 (2016-06-27)

  • Add Django 1.10 support

  • Drop Django 1.4 - 1.7, and Python 2.6 support

  • Drop South support

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)

  • Warn against using REUSE_DB=1 and FastFixtureTestCase in docs

  • REUSE_DB=1 uses new transaction management in Django 1.7, 1.8 (scottsexton)

  • Try to avoid accidentally using production database with REUSE_DB=1 (alexjg, eroninjapan)

  • Supported Django versions limited to current supported Django version 1.4, 1.7, and 1.8, as well as relevant Python versions.

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)._

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-nose-1.4.6.tar.gz (46.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_nose-1.4.6-py2.py3-none-any.whl (27.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-nose-1.4.6.tar.gz.

File metadata

  • Download URL: django-nose-1.4.6.tar.gz
  • Upload date:
  • Size: 46.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/36.2.7 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/2.7.10

File hashes

Hashes for django-nose-1.4.6.tar.gz
Algorithm Hash digest
SHA256 58934a06a6932696e54c9e8af3fab49bf67ca9e9c840ad668cb7f51219808a07
MD5 f8def9a2c9bff16966085f32e7e39c5e
BLAKE2b-256 91b40f84946a3f18c1b1c75c9eac8272f684dc1f3815b24c4941d59d433d8886

See more details on using hashes here.

File details

Details for the file django_nose-1.4.6-py2.py3-none-any.whl.

File metadata

  • Download URL: django_nose-1.4.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.4 setuptools/36.2.7 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/2.7.10

File hashes

Hashes for django_nose-1.4.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f515d903cfaeda52c7a9198e0c8ed51563e82802b62a4e5fbd056fd830095318
MD5 bf17a2062a5fdea2f2ef4e3889b1f7a8
BLAKE2b-256 8a411e8f98b1d54bbcd48cded9587ea5a12c74466e60ba6e4039e80915ede5b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page