mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #34060 -- Fixed crash when filtering against literal JSON with psycopg2.
This commit is contained in:
committed by
Mariusz Felisiak
parent
c991602ce5
commit
0d8fbe2ade
@@ -1120,3 +1120,10 @@ class TestQuerying(TestCase):
|
||||
KT("value")
|
||||
with self.assertRaisesMessage(ValueError, msg):
|
||||
KT("")
|
||||
|
||||
def test_literal_annotation_filtering(self):
|
||||
all_objects = NullableJSONModel.objects.order_by("id")
|
||||
qs = all_objects.annotate(data=Value({"foo": "bar"}, JSONField())).filter(
|
||||
data__foo="bar"
|
||||
)
|
||||
self.assertQuerySetEqual(qs, all_objects)
|
||||
|
||||
Reference in New Issue
Block a user