mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #13159 -- properly quote aggregates in order_by.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15318 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -747,6 +747,19 @@ class AggregationTests(TestCase):
|
||||
attrgetter("name")
|
||||
)
|
||||
|
||||
def test_quoting_aggregate_order_by(self):
|
||||
qs = Book.objects.filter(
|
||||
name="Python Web Development with Django"
|
||||
).annotate(
|
||||
authorCount=Count("authors")
|
||||
).order_by("authorCount")
|
||||
self.assertQuerysetEqual(
|
||||
qs, [
|
||||
("Python Web Development with Django", 3),
|
||||
],
|
||||
lambda b: (b.name, b.authorCount)
|
||||
)
|
||||
|
||||
@skipUnlessDBFeature('supports_stddev')
|
||||
def test_stddev(self):
|
||||
self.assertEqual(
|
||||
|
||||
Reference in New Issue
Block a user