Django includes a built-in testing framework (extending Python's unittest) with tools tailored to web applications — a test client for simulating requests, a fixtures/database system that creates an isolated test database, and helpers for testing models, views, and forms.
A basic test case
django.test TestCase
():
():
.article = Article.objects.create(title=, body=)
():
.assertEqual((.article), )
():
.assertFalse(.article.published)
