See also The testing tutorial, the testing tools reference, and the advanced testing topics.
This document is split into two primary sections. First, we explain how to write tests with Django. Then, we explain how to run them.
Writing tests
Django’s unit tests use a Python standard library module: unittest. This module defines tests using a class-based approach.
Here is an example which subclasses from django.test.TestCase, which is a subclass of unittest.TestCase that runs each test inside a