mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Used AND, OR, XOR constants instead of hard-coded values.
This commit is contained in:
committed by
Mariusz Felisiak
parent
e20e5d1557
commit
769d7cce4a
@@ -1,6 +1,7 @@
|
||||
import copy
|
||||
import unittest
|
||||
|
||||
from django.db.models.sql import AND, OR
|
||||
from django.utils.tree import Node
|
||||
|
||||
|
||||
@@ -56,9 +57,9 @@ class NodeTests(unittest.TestCase):
|
||||
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"))
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user