Interactive test runner for Django projects
Project description
djtest
An interactive test runner for Django projects.
Purposes:
keep the list of apps available for test in a local configuration file
display the list of all available unit tests (-l option)
run unit tests for apps specified on command line
cleanup a test “media folder” before each execution
optionally filter the list of unit tests to be executed (-f option)
Installation
pip install djtest
or:
pip install git+https://github.com/morlandi/djtest
Sample usage
Using config file "./.djtest.conf" usage: djtest [-h] [-v {0,1,2,3}] [-m] [-n] [-f FILTER] [-l] [apps [apps ...]] Targets may specify either: 'all' for all available apps, and app name (one or more), or a specific test module/method positional arguments: apps optional arguments: -h, --help show this help message and exit -v {0,1,2,3}, --verbosity {0,1,2,3} Verbosity level. (default: 2) -m, --no-migrations Skip migrations. (default: False) -n, --dry-run Don't execute commands, just pretend. (default: False) -f FILTER, --filter FILTER Filtering: run only test methods matching specified pattern -l, --list List available test methods --version show program's version number and exit Available apps: tasks, wallet_clients, frontend_api, trading_api, backend
Sample config file
A sample “skeleton” config file “./.djtest.conf” is automatically created on first run.
You should edit it to specify the list of testable apps.
[general] project=myproject test_settings_module=myproject.settings.test_settings test_settings_no_migrations_module=myproject.settings.test_settings_no_migrations media_folder="../public/test_media/" apps=app1, app2, appN
Sample “test settings” module
from myproject.settings.settings import * LANGUAGE_CODE = 'en' TIME_ZONE = 'UTC' EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' ...
Sample “test settings - no migrations” module
from myproject.settings.test_settings import * class DisableMigrations(object): def __contains__(self, item): return True def __getitem__(self, item): #return "notmigrations" return None MIGRATION_MODULES = DisableMigrations()
History
v0.1.2
cleanup
v0.1.1
add test settings example to Readme
v0.1.0
published on PyPI
v0.0.3
added versioning
added support for unittest.TestCase
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for djtest-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51eec20ef2479c1b4cfcc7fcf10133569fabc63859cfc066757f1b921fa47a80 |
|
MD5 | a6bafe3d3ee11263b9e344adc7bd60cf |
|
BLAKE2b-256 | 8546bed7acd5c420278ad05604d9daeca0943831285dc7a410e247f2494acc3c |