Author: russellm
Date: 2010-01-18 19:14:02 -0600 (Mon, 18 Jan 2010)
New Revision: 12261

Modified:
   django/trunk/django/test/simple.py
   django/trunk/docs/topics/testing.txt
   django/trunk/tests/modeltests/model_package/tests.py
Log:
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.

Modified: django/trunk/django/test/simple.py
===================================================================
--- django/trunk/django/test/simple.py  2010-01-18 23:53:08 UTC (rev 12260)
+++ django/trunk/django/test/simple.py  2010-01-19 01:14:02 UTC (rev 12261)
@@ -124,9 +124,9 @@
     return suite
 
 def build_test(label):
-    """Construct a test case a test with the specified label. Label should
-    be of the form model.TestClass or model.TestClass.test_method. Returns
-    an instantiated test or test suite corresponding to the label provided.
+    """Construct a test case with the specified label. Label should be of the
+    form model.TestClass or model.TestClass.test_method. Returns an
+    instantiated test or test suite corresponding to the label provided.
 
     """
     parts = label.split('.')
@@ -271,10 +271,10 @@
         """
         self.setup_test_environment()
 
+        suite = self.build_suite(test_labels, extra_tests)
+
         old_names = self.setup_databases()
 
-        suite = self.build_suite(test_labels, extra_tests)
-
         result = self.run_suite(suite)
 
         self.teardown_databases(old_names)

Modified: django/trunk/docs/topics/testing.txt
===================================================================
--- django/trunk/docs/topics/testing.txt        2010-01-18 23:53:08 UTC (rev 
12260)
+++ django/trunk/docs/topics/testing.txt        2010-01-19 01:14:02 UTC (rev 
12261)
@@ -1233,14 +1233,14 @@
 
     #. 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.
 
     #. Running ``syncdb`` to install models and initial data into the test
        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.
 
     #. Destroying the test databases.

Modified: django/trunk/tests/modeltests/model_package/tests.py
===================================================================
--- django/trunk/tests/modeltests/model_package/tests.py        2010-01-18 
23:53:08 UTC (rev 12260)
+++ django/trunk/tests/modeltests/model_package/tests.py        2010-01-19 
01:14:02 UTC (rev 12261)
@@ -37,7 +37,7 @@
 >>> a.sites.count()
 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.save()

-- 
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.


Reply via email to