﻿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
7835	Provide the ability for model definitions that are only availably during testing	Russell Keith-Magee	Josh Thomas	"
A current limitation of the unit test framework is that there is no capacity to define 'test models' - that is, models that are only required for the purposes of testing. A regular installation would not know anything about these models - only a test database would have access to them. 

There are several existing applications that have a need for this capability: For example:
 * contrib.admin: you can't test the way admin handles models without some models to handle. 
 * contrib.databrowse: you can't test the way the browser works without having models to browse
 * Django Evolution: you can't evolve models without having some models to evolve. 
 
The easiest way to work around this at present is to have a standalone test project which exercises the required functionality. However, these tests aren't integrated into the automated test suite, so they.

Another option is to do some app_cache munging during the test - this works, but is very messy.

Django should provide a way for model definitions to be defined as part of the test definition, synchronized as part of the test setup, populated and manipulated during test execution, and destroyed along with the test database.

"	New feature	assigned	Testing framework	dev	Normal		feature test models	martin@… oliver@… t.django@… steingrd@… kmike84@… adrianlopezcalvo@… daniel.samuels1@… maxime.lorant@… Ashley Waite Carlos Palol direx Simon Charette Mark Gregson Carlton Gibson Keryn Knight HarryKane	Accepted	0	0	0	0	0	0
