diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2011-01-26 03:48:15 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2011-01-26 03:48:15 +0000 |
| commit | 80287f1e8a554290faa6a0c31113a9f4eecf7b79 (patch) | |
| tree | 64fff017ad747c9716f4abf522406159a7ebb3da /tests | |
| parent | 91414c4bb825c65b0ebdcfcbaf39356befdbaf92 (diff) | |
Fixed #13159 -- properly quote aggregates in order_by.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15318 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/aggregation_regress/tests.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/regressiontests/aggregation_regress/tests.py b/tests/regressiontests/aggregation_regress/tests.py index ad79923a8a..67220b7c77 100644 --- a/tests/regressiontests/aggregation_regress/tests.py +++ b/tests/regressiontests/aggregation_regress/tests.py @@ -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( |
