Ticket #11627: test_suite.3.diff
File test_suite.3.diff, 2.4 KB (added by , 15 years ago) |
---|
-
django/test/simple.py
80 80 """ 81 81 parts = label.split('.') 82 82 if len(parts) < 2 or len(parts) > 3: 83 raise ValueError("Test label '%s' should be of the form app.TestCase or app. TestCase.test_method" % label)83 raise ValueError("Test label '%s' should be of the form app.TestCase or app.suite or app.TestCase.test_method" % label) 84 84 85 app_module = get_app(parts[0])86 TestClass = getattr( app_module, parts[1], None)85 module = get_app(parts[0]) 86 TestClass = getattr(module, parts[1], None) 87 87 88 88 # Couldn't find the test class in models.py; look in tests.py 89 89 if TestClass is None: 90 test_module = get_tests(app_module) 91 if test_module: 92 TestClass = getattr(test_module, parts[1], None) 93 94 if len(parts) == 2: # label is app.TestClass 90 module = get_tests(module) 91 if module: 92 TestClass = getattr(module, parts[1], None) 93 if len(parts) == 2: # label is app.TestClass or app.suite 95 94 try: 96 return unittest.TestLoader().loadTestsFrom TestCase(TestClass)95 return unittest.TestLoader().loadTestsFromName(parts[1], module) 97 96 except TypeError: 98 97 raise ValueError("Test label '%s' does not refer to a test class" % label) 99 98 else: # label is app.TestClass.test_method -
django/test/testcases.py
460 460 transaction.rollback() 461 461 transaction.leave_transaction_management() 462 462 connection.close() 463 464 465 class TestSuite(unittest.TestSuite): 466 pass -
django/test/__init__.py
3 3 """ 4 4 5 5 from django.test.client import Client 6 from django.test.testcases import TestCase, TransactionTestCase 6 from django.test.testcases import TestCase, TransactionTestCase, TestSuite -
tests/regressiontests/test_utils/models.py
1