Author: ramiro
Date: 2010-12-18 17:10:29 -0600 (Sat, 18 Dec 2010)
New Revision: 14982

Modified:
   django/branches/releases/1.2.X/tests/regressiontests/queries/tests.py
Log:
[1.2.X] Fixed a couple of tests migrated to unit tests in r14279 so they 
actually and correctly exercise the functionality under test.

Backport of [14981] from trunk.

Modified: django/branches/releases/1.2.X/tests/regressiontests/queries/tests.py
===================================================================
--- django/branches/releases/1.2.X/tests/regressiontests/queries/tests.py       
2010-12-18 23:03:23 UTC (rev 14981)
+++ django/branches/releases/1.2.X/tests/regressiontests/queries/tests.py       
2010-12-18 23:10:29 UTC (rev 14982)
@@ -27,6 +27,12 @@
         except Exception, e:
             self.assertEqual(msg, str(e))
             self.assertTrue(isinstance(e, exc), "Expected %s, got %s" % (exc, 
type(e)))
+        else:
+            if hasattr(exc, '__name__'):
+                excName = exc.__name__
+            else:
+                excName = str(exc)
+            raise AssertionError, "%s not raised" % excName
 
 
 class Queries1Tests(BaseQuerysetTest):
@@ -1516,12 +1522,12 @@
             self.assertRaisesMessage(
                 FieldError,
                 'Infinite loop caused by ordering.',
-                LoopX.objects.all
+                lambda: list(LoopX.objects.all()) # Force queryset evaluation 
with list()
             )
             self.assertRaisesMessage(
                 FieldError,
                 'Infinite loop caused by ordering.',
-                LoopZ.objects.all
+                lambda: list(LoopZ.objects.all()) # Force queryset evaluation 
with list()
             )
 
             # Note that this doesn't cause an infinite loop, since the default

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