#3782: Support for custom test suites ------------------------------------+--------------------------------------- Reporter: [EMAIL PROTECTED] | Owner: adrian Status: new | Component: Unit test system Version: SVN | Keywords: Stage: Unreviewed | Has_patch: 1 ------------------------------------+--------------------------------------- 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.
-- Ticket URL: <http://code.djangoproject.com/ticket/3782> Django Code <http://code.djangoproject.com/> The web framework for perfectionists with deadlines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
