diff options
| author | Michael Manfre <mmanfre@gmail.com> | 2013-09-23 20:52:58 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-09-24 10:10:08 -0400 |
| commit | 9a041807fcde7ff7245696a743196d31ec7c7b5c (patch) | |
| tree | 6d6ded8c685d6976198b72fd2c218b5e052c6733 /tests | |
| parent | 77f6b468e5b3a389b3e56e1e1f70a56e8a0a68fa (diff) | |
Fixed #18333 - Quoted annotated column names
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/aggregation_regress/tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/aggregation_regress/tests.py b/tests/aggregation_regress/tests.py index b8ec14d1dc..741e2ed734 100644 --- a/tests/aggregation_regress/tests.py +++ b/tests/aggregation_regress/tests.py @@ -1114,3 +1114,13 @@ class AggregationTests(TestCase): self.assertQuerysetEqual( qs, ['Sams Teach Yourself Django in 24 Hours'], lambda b: b.name) + + def test_annotate_reserved_word(self): + """ + Regression #18333 - Ensure annotated column name is properly quoted. + """ + vals = Book.objects.annotate(select=Count('authors__id')).aggregate(Sum('select'), Avg('select')) + self.assertEqual(vals, { + 'select__sum': 10, + 'select__avg': Approximate(1.666, places=2), + }) |
