Skip to main content

Slightly modified test utils from django-cms as a own module

Project description

Utils for test setup based on test utils from django-cms

Installation

For the current stable version:

pip install django-easytests

For the development version:

pip install -e git+git://github.com/fivethreeo/django-easytests.git#egg=django-easytests

Example usage in runshell.py:

#!/usr/bin/env python

import sys
import os

from djeasytests.testsetup import TestSetup, default_settings

# optionally add apps to path

local_apps = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'local_apps')
if not local_apps in sys.path:
    sys.path.append(local_apps)

# optionally add existing project settings

from djeasytests.utils import settings_to_dict
from project import settings
default_settings.update(settings_to_dict(settings))

default_settings.update(dict(
    ROOT_URLCONF='project.urls',
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': 'project.sqlite',
    },
    INSTALLED_APPS = [
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.admin',
        'django.contrib.sites',
        'django.contrib.staticfiles',
    ]
))

testsetup = TestSetup(appname='project', default_settings=default_settings)

if __name__ == '__main__':
    testsetup.run('shell') # Can be 'tests', 'shell', 'testserver' or 'manage'

Example usage in runmanage.py:

#!/usr/bin/env python

from runshell import testsetup

if __name__ == '__main__':
    testsetup.run('manage') # Can be 'tests', 'shell', 'testserver' or 'manage'

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-easytests-0.8.4.beta.0.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file django-easytests-0.8.4.beta.0.tar.gz.

File metadata

File hashes

Hashes for django-easytests-0.8.4.beta.0.tar.gz
Algorithm Hash digest
SHA256 06a4b99d6cb95569f642ce15a95a84ddc9148f0f6ce46b3cf6326872d0d838ff
MD5 ff2e59fcd0506471c49fa9f9127d2742
BLAKE2b-256 e79a7a71c69038726dc44e01c0e805c0f2fbe5c01853c745658f0204e6611516

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