summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorsage <laymonage@gmail.com>2020-11-18 11:50:06 +0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-11-25 20:30:38 +0100
commita7935fe9424fed9401e4c0a2a54e234007cf30da (patch)
treed5ec2a281bb5e018a9e23a40c047848df917f1bc /tests
parenta2abeb3de76624fe34d7f046183b94c98a7bd09f (diff)
[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
Diffstat (limited to 'tests')
-rw-r--r--tests/model_fields/test_jsonfield.py5
1 files changed, 5 insertions, 0 deletions
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):