Defined output_field of Func() in test_grouping_by_annotations_with_array_field_param().
output_field cannot be automatically determined because the first argument passed to ARRAY_LEN is an ArrayField and the second one is an integer.
This commit is contained in:
parent
2afa61e7d9
commit
5227101787
|
@ -489,7 +489,9 @@ class TestQuerying(PostgreSQLTestCase):
|
||||||
value = models.Value([1], output_field=ArrayField(models.IntegerField()))
|
value = models.Value([1], output_field=ArrayField(models.IntegerField()))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
NullableIntegerArrayModel.objects.annotate(
|
NullableIntegerArrayModel.objects.annotate(
|
||||||
array_length=models.Func(value, 1, function='ARRAY_LENGTH'),
|
array_length=models.Func(
|
||||||
|
value, 1, function='ARRAY_LENGTH', output_field=models.IntegerField(),
|
||||||
|
),
|
||||||
).values('array_length').annotate(
|
).values('array_length').annotate(
|
||||||
count=models.Count('pk'),
|
count=models.Count('pk'),
|
||||||
).get()['array_length'],
|
).get()['array_length'],
|
||||||
|
|
Loading…
Reference in New Issue