﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
20165	Doc test example may lead to programmer errors	Lorin Hochstein	Lorin Hochstein	"On the [https://docs.djangoproject.com/en/dev/topics/testing/overview/ Testing Django applications] page, the initial example subclasses from unittest.TestCase instead of django.test.TestCase.

Although there is some warning text beneath the example about the need to subclass from django.test.TestCase when hitting the database, it's likely that a Django programmer searching for a quick reference on how to structure a test class will treat this as a canonical example and miss the warning text below.  (I know at least one person who this has happened to).

I believe it would minimize programmer error to use django.test.TestCase and to have the accompanying test discuss how you can use unittest.TestCase as an optimization when the test doesn't hit the database (as in the example).

I submitted a [https://github.com/django/django/pull/903 pull request] but it was closed, referencing #15896, which is a slightly different issue. I also started a [https://github.com/django/django/pull/903 django-developers thread] about this.
"	Cleanup/optimization	closed	Documentation	dev	Normal	fixed		lorin@…	Accepted	1	0	0	1	0	1
