mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[3.2.x] Fixed #32717 -- Fixed filtering of querysets combined with the | operator.
Address a long standing bug in a Where.add optimization to discard equal nodes that was surfaced by implementing equality for Lookup instances inbbf141bcdc. Thanks Shaheed Haque for the report. Backport ofb81c7562fcfrom main
This commit is contained in:
committed by
Mariusz Felisiak
parent
d6b6eda4ed
commit
386caa5445
@@ -57,6 +57,11 @@ class NodeTests(unittest.TestCase):
|
||||
self.assertEqual(len(self.node1) + 1, len(node3))
|
||||
self.assertEqual(str(node3), "(DEFAULT: ('a', 1), ('b', 2), ('c', 3))")
|
||||
|
||||
def test_add_eq_child_mixed_connector(self):
|
||||
node = Node(['a', 'b'], 'OR')
|
||||
self.assertEqual(node.add('a', 'AND'), 'a')
|
||||
self.assertEqual(node, Node([Node(['a', 'b'], 'OR'), 'a'], 'AND'))
|
||||
|
||||
def test_negate(self):
|
||||
# negated is False by default
|
||||
self.assertFalse(self.node1.negated)
|
||||
|
||||
Reference in New Issue
Block a user