Code that works today can quietly break tomorrow. Automated tests let you change a Django project with confidence, because a failing test tells you exactly what you broke, and debugging tools help you find out why when something does not behave as expected.
In this module you will learn how to write unit tests for models and views using
Django's TestCase and the test client, how to run them, and how
pytest-django offers a more concise alternative. You will then
learn how to track down problems with the Django Debug Toolbar,
which shows the SQL queries, timings, and context behind each request.
Watch the lessons in order, then continue on to Security & Performance. Some of these videos were recorded on older Django releases, so check the official documentation if a detail differs on your install.
Covers the basic principles of testing and shows how to write effective tests for Django models and views.
Part of a Django unit testing series on unit and integration testing, this episode focuses on writing tests with the TestCase class.
Shows how to create tests for a Django application with the pytest-django package.
Walks through installing and configuring the Django Debug Toolbar and using it to debug your Django code.