Removed unnecessary json.loads() call in test_json_agg_empty().

This commit is contained in:
Nick Pope 2021-06-22 09:58:01 +01:00 committed by Mariusz Felisiak
parent e8e8e207e7
commit 66af94d56e
1 changed files with 1 additions and 3 deletions

View File

@ -1,5 +1,3 @@
import json
from django.db.models import CharField, F, OuterRef, Q, Subquery, Value from django.db.models import CharField, F, OuterRef, Q, Subquery, Value
from django.db.models.fields.json import KeyTextTransform, KeyTransform from django.db.models.fields.json import KeyTextTransform, KeyTransform
from django.db.models.functions import Cast, Concat, Substr from django.db.models.functions import Cast, Concat, Substr
@ -281,7 +279,7 @@ class TestGeneralAggregate(PostgreSQLTestCase):
def test_jsonb_agg_empty_result(self): def test_jsonb_agg_empty_result(self):
AggregateTestModel.objects.all().delete() AggregateTestModel.objects.all().delete()
values = AggregateTestModel.objects.aggregate(jsonbagg=JSONBAgg('integer_field')) values = AggregateTestModel.objects.aggregate(jsonbagg=JSONBAgg('integer_field'))
self.assertEqual(values, json.loads('{"jsonbagg": []}')) self.assertEqual(values, {'jsonbagg': []})
def test_jsonb_agg_charfield_ordering(self): def test_jsonb_agg_charfield_ordering(self):
ordering_test_cases = ( ordering_test_cases = (