Fixed #30155 -- Dropped support for PostgreSQL 9.4 and PostGIS 2.1.

This commit is contained in:
Tim Graham 2019-02-04 11:07:46 -05:00
parent d47498c5df
commit 39ebdf5a3c
13 changed files with 21 additions and 78 deletions

View file

@ -1,7 +1,6 @@
import json
from django.db.models.expressions import F, Value
from django.test.testcases import skipUnlessDBFeature
from django.test.utils import Approximate
from . import PostgreSQLTestCase
@ -184,12 +183,10 @@ class TestGeneralAggregate(PostgreSQLTestCase):
)
self.assertEqual(values, {'arrayagg': [0, 1, 0, 2]})
@skipUnlessDBFeature('has_jsonb_agg')
def test_json_agg(self):
values = AggregateTestModel.objects.aggregate(jsonagg=JSONBAgg('char_field'))
self.assertEqual(values, {'jsonagg': ['Foo1', 'Foo2', 'Foo4', 'Foo3']})
@skipUnlessDBFeature('has_jsonb_agg')
def test_json_agg_empty(self):
values = AggregateTestModel.objects.none().aggregate(jsonagg=JSONBAgg('integer_field'))
self.assertEqual(values, json.loads('{"jsonagg": []}'))