Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run multiple Django application tests with one command

I have a Django project with multiple apps, app_1, app_2, and app_3. Currently, in order to run the test suite, I use the standard testing command: python manage.py test. This runs the tests for all of my apps. I am also able to run tests for a single app, specifically -- for example, python manage.py test app_1/. However, I'd like to be able to run all of the tests in some, but not all, of my apps. For example, I'd run python manage.py test main_tests and just have the tests in app_1 and app_2 run. Is there a way to do this?

I saw that this question specified how to run just a few tests within a single app, but not how to run just a few apps' tests within a project.

like image 576
orange1 Avatar asked Nov 27 '25 01:11

orange1


1 Answers

You can supply multiple labels to the test command:

python manage.py test app_1 app_2

This will run all tests in app_1 and app_2.

like image 116
knbk Avatar answered Nov 29 '25 16:11

knbk