Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #16480 -- Modified test added in r16522 so it doesn't use a que…

…ry not supported under Oracle (`GROUP BY` a NCLOB field). Thanks Aymeric for the report. Refs #4186

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16546 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0452d4c3cce8b41e01a21977cf35341712e70e7c 1 parent 9896b0d
@ramiro ramiro authored
View
10 tests/regressiontests/defer_regress/models.py
@@ -36,3 +36,13 @@ class ResolveThis(models.Model):
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)
View
11 tests/regressiontests/defer_regress/tests.py
@@ -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 @@ def test():
self.assertEqual(
klasses, [
Child,
+ Feature,
Item,
Leaf,
Proxy,
RelatedItem,
ResolveThis,
+ SimpleItem,
]
)
@@ -128,6 +131,7 @@ def test():
klasses, [
"Child",
"Child_Deferred_value",
+ "Feature",
"Item",
"Item_Deferred_name",
"Item_Deferred_name_other_value_text",
@@ -144,12 +148,13 @@ def test():
"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
Please sign in to comment.
Something went wrong with that request. Please try again.