From a7935fe9424fed9401e4c0a2a54e234007cf30da Mon Sep 17 00:00:00 2001 From: sage Date: Wed, 18 Nov 2020 11:50:06 +0700 Subject: [3.1.x] Fixed #32203 -- Fixed QuerySet.values()/values_list() crash on key transforms with non-string values on SQLite. Thanks Gordon Wrigley for the report. Backport of fe6e5824218bab7cf47dee112d68325b338f9947 from master --- tests/model_fields/test_jsonfield.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/model_fields') diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py index 38081d0b85..f041c659d1 100644 --- a/tests/model_fields/test_jsonfield.py +++ b/tests/model_fields/test_jsonfield.py @@ -262,6 +262,7 @@ class TestQuerying(TestCase): 'k': {'l': 'm'}, 'n': [None], 'o': '"quoted"', + 'p': 4.2, }, [1, [2]], {'k': True, 'l': False}, @@ -684,10 +685,14 @@ class TestQuerying(TestCase): qs = NullableJSONModel.objects.filter(value__h=True) tests = [ ('value__a', 'b'), + ('value__c', 14), ('value__d', ['e', {'f': 'g'}]), + ('value__h', True), + ('value__i', False), ('value__j', None), ('value__k', {'l': 'm'}), ('value__n', [None]), + ('value__p', 4.2), ] for lookup, expected in tests: with self.subTest(lookup=lookup): -- cgit v1.3