Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Nose2 plugin to run django tests through nose2 instead of the django test runner.

Project Description

A plugin pair for nose2 that runs your django (>=1.4) tests through the nose2 command and also supports django-configurations settings management. It lets django initialise the test environment and setup the order of the test suite, but nose2/unittest2 handles the test discovery and execution.

There is another project called django-nose which is authored by one of the nose2 devs. It uses the standard django approach of setting an alternative test runner and running via I was interested with the move to shift configuration into setup.cfg and wanted to try that pattern for running tests rather that wrapping configuration into a custom test runner. Modern django has refactored the way a project is initialised which means there is less dependency on using and as the only possible entry points into your django project.


$ pip install nose2django

Create a nose2.cfg file in your project’s root directory (where is) and register the plugins in the correct order:

plugins = nose2django.config

always-on = True

# optional settings
settings = yourproject.settings
configuration = YourTestConfiguration

always-on = True

You can optionally set the settings and configuration to a django settings module and a django-configurations configuration. It takes precedence over any existing environment.


As per nose2, optionally with either of the django-runner options.

$ nose2 --settings=example.settings.test --configuration=TestSettings


For django app test driven development of apps you want only as much django settings as required. Create a tests folder in your top level directory (avoid using the name tests - use something like test_yourapp to avoid name clashes), and put a minimal settings file in there and an file to make it importable. Something like:

    'default': {
        'ENGINE': 'django.db.backends.sqlite3' }

    ROOT_URLCONF='yourapp.urls', # if you have urls
    SECRET_KEY = '1234'


nose2django re-uses parts of the existing django test runner code as licensed by django.


v0.1.2 (2013-4-13)

  • Add South compatibility.

v0.1.1 (2013-4-6)

  • Fix issue with django logging setup when nose -v.

v0.1 (2013-03-29)

  • Initial public (correctly packaged) release. Thanks tox.
Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
nose2django-0.1.2.tar.gz (4.8 kB) Copy SHA256 Checksum SHA256 Source Apr 13, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting