1
0
mirror of https://github.com/django/django.git synced 2025-10-27 15:46:10 +00:00

[3.1.x] Fixed #31659 -- Made ExpressionWrapper preserve output_field for combined expressions.

Regression in df32fd42b8.

Thanks Simon Charette for the review.

Backport of aeb8996a67 from master
This commit is contained in:
Mariusz Felisiak
2020-06-11 11:29:14 +02:00
parent 45ec013116
commit 42f5f2d76b
3 changed files with 14 additions and 1 deletions

View File

@@ -1837,4 +1837,6 @@ class ExpressionWrapperTests(SimpleTestCase):
def test_non_empty_group_by(self):
expr = ExpressionWrapper(Lower(Value('f')), output_field=IntegerField())
self.assertEqual(expr.get_group_by_cols(alias=None), [expr.expression])
group_by_cols = expr.get_group_by_cols(alias=None)
self.assertEqual(group_by_cols, [expr.expression])
self.assertEqual(group_by_cols[0].output_field, expr.output_field)