Refs #31094 -- Added test for not using aliases in GROUP BY clauses.

This commit is contained in:
Simon Charette 2019-12-19 09:10:02 +01:00 committed by Mariusz Felisiak
parent 35d36d9462
commit a0f34d8fef
1 changed files with 2 additions and 0 deletions

View File

@ -1138,6 +1138,8 @@ class AggregateTestCase(TestCase):
with self.assertNumQueries(1) as ctx:
list(publisher_qs)
self.assertEqual(ctx[0]['sql'].count('SELECT'), 2)
# The GROUP BY should not be by alias either.
self.assertEqual(ctx[0]['sql'].lower().count('latest_book_pubdate'), 1)
@skipUnlessDBFeature('supports_subqueries_in_group_by')
def test_group_by_subquery_annotation(self):