How do you approach testing in a Django project, and how much testing is enough?
Give a hierarchy rather than a coverage number, because coverage percentage is a weak proxy and interviewers know it.
- Model and business logic tests are the highest value per line. They are fast, they do not need the HTTP layer, and they catch the bugs that corrupt data.
- View and API tests using Django's test client or DRF's
APIClient, focused on permissions and status codes. Authorisation bugs are the ones that actually hurt, so test that the wrong user gets a 403. - Integration tests for the few flows that must never break — signup, checkout, payment.
- End-to-end browser tests sparingly. They are slow and flaky, so reserve them for a handful of critical journeys.
On "how much": enough that you can deploy on a Friday. Concretely, that means every bug fix arrives with a regression test, anything involving money or permissions is covered, and the suite runs fast enough that people actually run it.
Note: Mention factory_boy over fixtures, and pytest-django if you use it. Both signal practical experience.





