Author: ramiro
Date: 2011-07-17 15:22:39 -0700 (Sun, 17 Jul 2011)
New Revision: 16546

Modified:
   django/trunk/tests/regressiontests/defer_regress/models.py
   django/trunk/tests/regressiontests/defer_regress/tests.py
Log:
Fixed #16480 -- Modified test added in r16522 so it doesn't use a query not 
supported under Oracle (`GROUP BY` a NCLOB field). Thanks Aymeric for the 
report. Refs #4186

Modified: django/trunk/tests/regressiontests/defer_regress/models.py
===================================================================
--- django/trunk/tests/regressiontests/defer_regress/models.py  2011-07-17 
14:17:26 UTC (rev 16545)
+++ django/trunk/tests/regressiontests/defer_regress/models.py  2011-07-17 
22:22:39 UTC (rev 16546)
@@ -36,3 +36,13 @@
 class Proxy(Item):
     class Meta:
         proxy = True
+
+class SimpleItem(models.Model):
+    name = models.CharField(max_length=15)
+    value = models.IntegerField()
+
+    def __unicode__(self):
+        return self.name
+
+class Feature(models.Model):
+    item = models.ForeignKey(SimpleItem)

Modified: django/trunk/tests/regressiontests/defer_regress/tests.py
===================================================================
--- django/trunk/tests/regressiontests/defer_regress/tests.py   2011-07-17 
14:17:26 UTC (rev 16545)
+++ django/trunk/tests/regressiontests/defer_regress/tests.py   2011-07-17 
22:22:39 UTC (rev 16546)
@@ -6,7 +6,8 @@
 from django.db.models.loading import cache
 from django.test import TestCase
 
-from models import ResolveThis, Item, RelatedItem, Child, Leaf, Proxy
+from models import (ResolveThis, Item, RelatedItem, Child, Leaf, Proxy,
+        SimpleItem, Feature)
 
 
 class DeferRegressionTest(TestCase):
@@ -108,11 +109,13 @@
         self.assertEqual(
             klasses, [
                 Child,
+                Feature,
                 Item,
                 Leaf,
                 Proxy,
                 RelatedItem,
                 ResolveThis,
+                SimpleItem,
             ]
         )
 
@@ -128,6 +131,7 @@
             klasses, [
                 "Child",
                 "Child_Deferred_value",
+                "Feature",
                 "Item",
                 "Item_Deferred_name",
                 "Item_Deferred_name_other_value_text",
@@ -144,12 +148,13 @@
                 "RelatedItem_Deferred_",
                 "RelatedItem_Deferred_item_id",
                 "ResolveThis",
+                "SimpleItem",
             ]
         )
 
         # Regression for #16409 - make sure defer() and only() work with 
annotate()
-        
self.assertIsInstance(list(Item.objects.annotate(Count('relateditem')).defer('name')),
 list)
-        
self.assertIsInstance(list(Item.objects.annotate(Count('relateditem')).only('name')),
 list)
+        
self.assertIsInstance(list(SimpleItem.objects.annotate(Count('feature')).defer('name')),
 list)
+        
self.assertIsInstance(list(SimpleItem.objects.annotate(Count('feature')).only('name')),
 list)
 
     def test_only_and_defer_usage_on_proxy_models(self):
         # Regression for #15790 - only() broken for proxy models

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to