Skip to main content

A base framework to write a simple runtests.py script for django apps.

Project description

Eases the writing of a runtests.py script for pluggable django application.

Such scripts usually provide a runtests() method that handle the test running behaviour.

Installation

  • Globally:

    $ pip install django-runtests
  • From the package’s setup.py file (using Distribute):

    setup(
        test_requires=[
            'django-runtests',
        ],
        test_suite='runtests.runtests',
    )

Defining the test setup

In your runtests.py file, add the following code:

import django_runtests

class Tests(django_runtests.RunTests):
    TESTED_APPS = ['my.app.to.test', 'my.other.test']

    EXTRA_APPS = [
        'django.contrib.auth',
        # Other custom apps to include
    ]

    EXTRA_SETTINGS = {
        # Custom settings, as a dict
    }

def runtests():
    return Tests.runtests()

if __name__ == '__main__':
    Tests.main()

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_runtests-0.3.0.tar.gz (9.9 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django_runtests-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c7961697818c622c2bee58fec15af4307d69ec6f3d4a78a625785251168cde18
MD5 b219c3d12a3d3eceb1d22363873a7d26
BLAKE2b-256 00334c428a28fec41e822b40987d845f4242f7e0e630ec58525c04ba0c21e370

See more details on using hashes here.

Supported by

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