[2.1.x] Fixed test_json.TestQuerying.test_key_transform_expression() on Python 3.5.

Backport of 6624a3de28 from stable/2.2.x
This commit is contained in:
Mariusz Felisiak 2019-08-15 19:38:12 +02:00
parent 968b9af9b7
commit 2a996a4a19
1 changed files with 1 additions and 0 deletions

View File

@ -168,6 +168,7 @@ class TestQuerying(PostgreSQLTestCase):
self.assertSequenceEqual( self.assertSequenceEqual(
JSONModel.objects.filter(field__d__0__isnull=False).annotate( JSONModel.objects.filter(field__d__0__isnull=False).annotate(
key=KeyTransform('d', 'field'), key=KeyTransform('d', 'field'),
).annotate(
chain=KeyTransform('0', 'key'), chain=KeyTransform('0', 'key'),
expr=KeyTransform('0', Cast('key', JSONField())), expr=KeyTransform('0', Cast('key', JSONField())),
).filter(chain=F('expr')), ).filter(chain=F('expr')),