#32657: Combining an empty Q with a negated Exists un-negates the Exists lookup
-----------------------------------------+------------------------
Reporter: Jaap Roes | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
The following test case fails in Django 3.2 and main:
{{{
class TestEmptyQExistsCombination(TestCase):
def test_combine(self):
q = Q() & Exists(Book.objects.all())
self.assertFalse(q.negated) # passes
def test_combine_negated(self):
q = Q() & ~Exists(Book.objects.all())
self.assertTrue(q.negated) # fails
}}}
I noticed this issue trying to work around issue #32651/ #32548.
--
Ticket URL: <https://code.djangoproject.com/ticket/32657>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.b72dba66131e2da1297e424883dcd178%40djangoproject.com.