mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	Fixed #12640 -- Corrected a regression in test suite construction order introduced by #12255. Also updated the docs to reflect what the test code has always done. Thanks to Ramiro Morales for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -124,9 +124,9 @@ def build_suite(app_module): | |||||||
|     return suite |     return suite | ||||||
|  |  | ||||||
| def build_test(label): | def build_test(label): | ||||||
|     """Construct a test case a test with the specified label. Label should |     """Construct a test case with the specified label. Label should be of the | ||||||
|     be of the form model.TestClass or model.TestClass.test_method. Returns |     form model.TestClass or model.TestClass.test_method. Returns an | ||||||
|     an instantiated test or test suite corresponding to the label provided. |     instantiated test or test suite corresponding to the label provided. | ||||||
|  |  | ||||||
|     """ |     """ | ||||||
|     parts = label.split('.') |     parts = label.split('.') | ||||||
| @@ -271,10 +271,10 @@ class DjangoTestSuiteRunner(object): | |||||||
|         """ |         """ | ||||||
|         self.setup_test_environment() |         self.setup_test_environment() | ||||||
|  |  | ||||||
|         old_names = self.setup_databases() |  | ||||||
|  |  | ||||||
|         suite = self.build_suite(test_labels, extra_tests) |         suite = self.build_suite(test_labels, extra_tests) | ||||||
|  |  | ||||||
|  |         old_names = self.setup_databases() | ||||||
|  |  | ||||||
|         result = self.run_suite(suite) |         result = self.run_suite(suite) | ||||||
|  |  | ||||||
|         self.teardown_databases(old_names) |         self.teardown_databases(old_names) | ||||||
|   | |||||||
| @@ -1233,14 +1233,14 @@ testing behavior. This behavior involves: | |||||||
|  |  | ||||||
|     #. Performing global pre-test setup. |     #. Performing global pre-test setup. | ||||||
|  |  | ||||||
|  |     #. Looking for unit tests and doctests in the ``models.py`` and | ||||||
|  |        ``tests.py`` files in each installed application. | ||||||
|  |  | ||||||
|     #. Creating the test databases. |     #. Creating the test databases. | ||||||
|  |  | ||||||
|     #. Running ``syncdb`` to install models and initial data into the test |     #. Running ``syncdb`` to install models and initial data into the test | ||||||
|        databases. |        databases. | ||||||
|  |  | ||||||
|     #. Looking for unit tests and doctests in the ``models.py`` and |  | ||||||
|        ``tests.py`` files in each installed application. |  | ||||||
|  |  | ||||||
|     #. Running the unit tests and doctests that are found. |     #. Running the unit tests and doctests that are found. | ||||||
|  |  | ||||||
|     #. Destroying the test databases. |     #. Destroying the test databases. | ||||||
|   | |||||||
| @@ -37,7 +37,7 @@ __test__ = {'API_TESTS': """ | |||||||
| >>> a.sites.count() | >>> a.sites.count() | ||||||
| 1 | 1 | ||||||
|  |  | ||||||
| # Regression for #12248 - Models can exist in the test package, too | # Regression for #12245 - Models can exist in the test package, too | ||||||
|  |  | ||||||
| >>> ad = Advertisment(customer="Lawrence Journal-World") | >>> ad = Advertisment(customer="Lawrence Journal-World") | ||||||
| >>> ad.save() | >>> ad.save() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user