diff options
author | Simon Charette <simon.charette@zapier.com> | 2019-10-08 09:56:36 -0400 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-06-24 12:26:36 +0200 |
commit | 5227101787007b255b0de9eda9b261bcbbe81b15 (patch) | |
tree | 96b725747ab95cd2329d1349ac4582a15d08c267 /tests/postgres_tests/test_array.py | |
parent | 2afa61e7d99b2ff2656dc64b6e28db88baf786a4 (diff) | |
download | django-5227101787007b255b0de9eda9b261bcbbe81b15.tar.gz |
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.
Diffstat (limited to 'tests/postgres_tests/test_array.py')
-rw-r--r-- | tests/postgres_tests/test_array.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index ee66fbcd60..df95e251ec 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -489,7 +489,9 @@ class TestQuerying(PostgreSQLTestCase): value = models.Value([1], output_field=ArrayField(models.IntegerField())) self.assertEqual( 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( count=models.Count('pk'), ).get()['array_length'], |