Skip to main content

django-quick-test

Django quick test is a custom nose based test runner that separates testing and test related database manipulations.

Usualy running this command instead of the default manage.py test will give you 10-15 times speed boost. So you will be able to run your test suite in seconds instead of minutes.

Installation

  1. Download the tarball and run python setup.py install

  2. Add quick_test to your INSTALLED_APPS list in settings.py

INSTALLED_APPS = ('quick_test')
  1. Add your test database details in settings.py

DATABASES = {
        'default':{
                'ENGINE':''},
        'test':{
                'ENGINE': '',
                'NAME': 'test_database',
        }
}
  1. And finally replace the default Django test runner with this one. Again in settings.py:

TEST_RUNNER = 'quick_test.NoseTestSuiteRunner'

Usage

django-quick-test assumes that you have created your test database manualy and you have loaded the required test data(fixtures)

Commands you have to run before using the command

python manage.py syncdb --database=test
python manage.py migrate --database=test

and finaly run your tests with

python manage.py quick_test

Additional notes

If you are using the default Django TestCase class you have to ovewrite the _pre_setup method which is executed automatically when you call the class. If you don’t overwrite it the quick_test command will still work, but your test data will be lost. Even if you don’t have any fixtures in the database overwriting this method will give you additional speed boost.

from django.test import TestCase

class SimpleTest(TestCase)

        def _pre_setup(self):
                # this method flushes the database and installs
                # the fixtures defined in the fixtures=[] list
                # we are doing everything manually, so we don't
                # really need it

        # these are the results I get with 1 test before
        and after ovewriting the method
        # Before -> Ran 1 test in 2.336s
        # After -> Ran 1 test in 0.004s
                pass

        def test_basic_addition(self):
                self.assertEqual(1 + 1, 2)

Requirements

Django 1.2+

nose

Download files

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

Source Distribution

django_quick_test-0.3.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distributions

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

django_quick_test-0.3.0.linux-i686.exe (70.5 kB view details)

Uploaded Source

django_quick_test-0.3.0-py2.6.egg (10.1 kB view details)

Uploaded Egg

File details

Details for the file django_quick_test-0.3.0.tar.gz.

File metadata

File hashes

Hashes for django_quick_test-0.3.0.tar.gz
Algorithm Hash digest
SHA256 31ed83e405cc09ac671a56a7fa203fd35ab93af3abc6f747ba96250ce7be33ff
MD5 9d6b4c803e65fcd6f9b73fdd8e520425
BLAKE2b-256 0fc42e7da11a403685526c422ccc6aef653702861484b17a4270cf86c0eff842

See more details on using hashes here.

File details

Details for the file django_quick_test-0.3.0.linux-i686.exe.

File metadata

File hashes

Hashes for django_quick_test-0.3.0.linux-i686.exe
Algorithm Hash digest
SHA256 003baa89a58fa85585cb51928f44adb9c9f4be293ee809b1439915617f76bccd
MD5 e3d528cb04c40ea994db25ef88294982
BLAKE2b-256 be1be7993a00037542f267620e1a16cfba4da05c4262737bb6dff5cf1b033962

See more details on using hashes here.

File details

Details for the file django_quick_test-0.3.0-py2.6.egg.

File metadata

File hashes

Hashes for django_quick_test-0.3.0-py2.6.egg
Algorithm Hash digest
SHA256 e17808111022b104e288a852a32c21e08eb3e935751dc6a9a52fb15f98f6b52c
MD5 06e8ec4a915d0f11b583956aa5b49a2d
BLAKE2b-256 43fce8763e8e92c8466d897e2fccfab96942af030e169b9ae02b817ab8ac88e2

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.1

1 file

This release

0.3.0 This release

3 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page