Refs #28762 -- Added test for aggregating over a function with ArrayField parameters.
Fixed in d87bd29c4f
.
This commit is contained in:
parent
654614b38e
commit
ceab25bc6d
|
@ -385,6 +385,17 @@ class TestQuerying(PostgreSQLTestCase):
|
||||||
with self.assertRaisesMessage(FieldError, msg):
|
with self.assertRaisesMessage(FieldError, msg):
|
||||||
list(NullableIntegerArrayModel.objects.filter(field__0bar=[2]))
|
list(NullableIntegerArrayModel.objects.filter(field__0bar=[2]))
|
||||||
|
|
||||||
|
def test_grouping_by_annotations_with_array_field_param(self):
|
||||||
|
value = models.Value([1], output_field=ArrayField(models.IntegerField()))
|
||||||
|
self.assertEqual(
|
||||||
|
NullableIntegerArrayModel.objects.annotate(
|
||||||
|
array_length=models.Func(value, 1, function='ARRAY_LENGTH'),
|
||||||
|
).values('array_length').annotate(
|
||||||
|
count=models.Count('pk'),
|
||||||
|
).get()['array_length'],
|
||||||
|
1,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestDateTimeExactQuerying(PostgreSQLTestCase):
|
class TestDateTimeExactQuerying(PostgreSQLTestCase):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue