django-admin test [test_label]

Discover and run tests in the specified modules or the current directory

Arguments

NameDescription
test_labelModule paths to test; can be modulename, modulename.TestCase or modulename.TestCase.test_method

Options

NameDescription
--noinput, --no-inputTells Django to NOT prompt the user for input of any kind
--failfastTells Django to stop running the test suite after first failed test
--testrunner <TESTRUNNER>Tells Django to use specified test runner class instead of the one specified by the TEST_RUNNER setting
-t, --top-level-directory <TOP_LEVEL>Top level of project for unittest discovery
-p, --pattern <PATTERN>The test matching pattern. Defaults to test*.py
--keepdbPreserves the test DB between runs
-r, --reverseReverses test cases order
--debug-modeSets settings.DEBUG to True
-d, --debug-sqlPrints logged SQL queries on failure
--parallel <[N]>Run tests using up to N parallel processes
--tag <TAGS>Run only tests with the specified tag. Can be used multiple times
--exclude-tag <EXCLUDE_TAGS>Do not run tests with the specified tag. Can be used multiple times
--pdbRuns a debugger (pdb, or ipdb if installed) on error or failure
-b, --bufferDiscard output from passing tests
-k <TEST_NAME_PATTERNS>Only run test methods and classes that match the pattern or substring. Can be used multiple times. Same as unittest -k option
-h, --helpShow this help message and exit
--versionShow program's version number and exit
-v, --verbosity <{0,1,2,3}>Verbosity level; 0=minimal output, 1=normal output, 2=verbose output, 3=very verbose output
--settings <SETTINGS>The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used
--pythonpath <PYTHONPATH>A directory to add to the Python path, e.g. "/home/djangoprojects/myproject"
--tracebackRaise on CommandError exceptions
--no-colorDon't colorize the command output
--force-colorForce colorization of the command output