Running Tests with manage.py
Running the full test suite
The simplest invocation runs every discovered test across all apps in the project.
Example: Running the full test suite
The simplest invocation runs every discovered test across all apps in the project.
python manage.py test
⚠️ Run this command in your terminal.
Running tests for one app
Narrowing the command to a single app's dotted path speeds up the feedback loop while working on that app.
Example: Running tests for one app
Narrowing the command to a single app's dotted path speeds up the feedback loop while working on that app.
python manage.py test myapp
⚠️ Run this command in your terminal.
Running a single test method
A fully dotted path down to the method lets you re-run just the test you're actively debugging.
Example: Running a single test method
A fully dotted path down to the method lets you re-run just the test you're actively debugging.
python manage.py test myapp.tests.BookModelTests.test_book_title_saved
⚠️ Run this command in your terminal.
- Running tests against the real development database by mistake — Django always creates a separate test database automatically, so this fear is misplaced but confuses beginners who don't realize it.
- Not narrowing the test command to one app while debugging, making the feedback loop slower than necessary.
- Ignoring a skipped or errored test in the output instead of investigating why it did not run.
- python manage.py test discovers and runs every test in every installed app.
- You can target a specific app, class, or method with dotted paths.
- The command prints a dot per passing test and a full traceback per failure.
- A summary line at the end reports how many tests ran, and whether they all passed.
Chapter Quiz — Complete all 9 topics to unlock
0/9 topics done
Complete these topics first: