commit ae426c0216803835b3406f37987033ea7b2d5cb0
Author: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Date: Tue Jul 12 10:29:15 2022 +0200
Fixed #33820 --
Thanks Johnny Metz for the report.
Regression in 71ec102b01fcc85acae3819426a4e02ef423b0fa.
diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py
index 25dfef7a24..5104f5273d 100644
a
|
b
|
class TestQuerying(TestCase):
|
293 | 293 | "o": '"quoted"', |
294 | 294 | "p": 4.2, |
295 | 295 | "r": {"s": True, "t": False}, |
| 296 | "s": "null", |
296 | 297 | }, |
297 | 298 | [1, [2]], |
298 | | {"k": True, "l": False, "foo": "bax"}, |
| 299 | {"k": True, "l": False, "s": None, "foo": "bax"}, |
299 | 300 | { |
300 | 301 | "foo": "bar", |
301 | 302 | "baz": {"a": "b", "c": "d"}, |
… |
… |
class TestQuerying(TestCase):
|
325 | 326 | [self.objs[3]], |
326 | 327 | ) |
327 | 328 | |
| 329 | def test_exact_null(self): |
| 330 | self.assertSequenceEqual( |
| 331 | NullableJSONModel.objects.filter(value__s=Value("null")), |
| 332 | [self.objs[6]], |
| 333 | ) |
| 334 | self.assertSequenceEqual( |
| 335 | NullableJSONModel.objects.filter(value__s="null"), |
| 336 | [self.objs[4]], |
| 337 | ) |
| 338 | |
328 | 339 | def test_icontains(self): |
329 | 340 | self.assertCountEqual( |
330 | 341 | NullableJSONModel.objects.filter(value__icontains="BaX"), |
… |
… |
class TestQuerying(TestCase):
|
894 | 905 | ("value__n", [None, True, False]), |
895 | 906 | ("value__p", 4.2), |
896 | 907 | ("value__r", {"s": True, "t": False}), |
| 908 | ("value__s", "null"), |
897 | 909 | ] |
898 | 910 | for lookup, expected in tests: |
899 | 911 | with self.subTest(lookup=lookup): |