Testing in Django
Django is a feature-packed framework that aims to make web application development rapid. It also provides a full-featured way of testing applications.
Django provides a well-integrated module that allows application developers to write unit tests for their applications. This module is based on the Python unittest
library, which ships with most of the Python distributions pre-packaged.
So, let’s get started by understanding how we can write basic test cases in Django and how to leverage the framework-provided modules to test our application code.
Implementing test cases
While working on implementing mechanisms for testing your code, the first thing you need to understand is how this implementation can be logically grouped so that modules that are closely related to each other are tested in one logical unit.
This can be simplified by implementing a test case. A test case is nothing more than a logical unit that groups together tests that are related...