summaryrefslogtreecommitdiff
path: root/tests/expressions/tests.py
diff options
context:
space:
mode:
authorRyan Heard <ryanwheard@gmail.com>2021-07-02 15:09:13 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-03-04 12:55:37 +0100
commitc6b4d62fa2c7f73b87f6ae7e8cf1d64ee5312dc5 (patch)
tree238bd8c3045c8d4577e09bd913de9748dcd49968 /tests/expressions/tests.py
parent795da6306a048b18c0158496b0d49e8e4f197a32 (diff)
downloaddjango-c6b4d62fa2c7f73b87f6ae7e8cf1d64ee5312dc5.tar.gz
Fixed #29865 -- Added logical XOR support for Q() and querysets.
Diffstat (limited to 'tests/expressions/tests.py')
-rw-r--r--tests/expressions/tests.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index c7488d7e25..12bf8996d1 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -2339,7 +2339,9 @@ class ReprTests(SimpleTestCase):
class CombinableTests(SimpleTestCase):
- bitwise_msg = "Use .bitand() and .bitor() for bitwise logical operations."
+ bitwise_msg = (
+ "Use .bitand(), .bitor(), and .bitxor() for bitwise logical operations."
+ )
def test_negation(self):
c = Combinable()
@@ -2353,6 +2355,10 @@ class CombinableTests(SimpleTestCase):
with self.assertRaisesMessage(NotImplementedError, self.bitwise_msg):
Combinable() | Combinable()
+ def test_xor(self):
+ with self.assertRaisesMessage(NotImplementedError, self.bitwise_msg):
+ Combinable() ^ Combinable()
+
def test_reversed_and(self):
with self.assertRaisesMessage(NotImplementedError, self.bitwise_msg):
object() & Combinable()
@@ -2361,6 +2367,10 @@ class CombinableTests(SimpleTestCase):
with self.assertRaisesMessage(NotImplementedError, self.bitwise_msg):
object() | Combinable()
+ def test_reversed_xor(self):
+ with self.assertRaisesMessage(NotImplementedError, self.bitwise_msg):
+ object() ^ Combinable()
+
class CombinedExpressionTests(SimpleTestCase):
def test_resolve_output_field(self):