﻿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
3782	Support for custom test suites	rene.puls@…	Adrian Holovaty	"Django uses unittest.defaultTestLoader.loadTestsFromModule for automatically building a test suite from a module. The Python unittest documentation [http://docs.python.org/lib/organizing-tests.html suggests that test modules provide a ""suite"" functon] that returns a pre-built test suite. This is useful if you have test case classes that accept/require additional initialization parameters.

(In my own project, for example, I have some feature tests that need to be run under different user environments, first as an anonymous user, then as a registered user. Instead of writing the same test twice or building a loop around it, I just create two test case instances which different ""user"" parameters.)

The attached patch for django/test/simple.py checks if the ""tests"" module of an app has a ""suite"" attribute. If this is the case, we assume it is a function that returns a complete suite for this module, otherwise we build the test suite ourselves using loadTestsFromModule.
"		closed	Testing framework	dev		fixed		rene.puls@…	Accepted	1	0	0	0	0	0
