summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorvarunkasyap <varunkasyap@hotmail.com>2026-04-02 14:56:45 +0530
committerJacob Walls <jacobtylerwalls@gmail.com>2026-04-03 09:37:32 -0400
commit3b161e60964aff99eddcd2627a486d81c1836b3a (patch)
treed6fe0a8d107a98826ba8b4b1d632acedf2d7f960 /tests
parent123fa3a3f38abdb73055acc9a2cbbe3537f9323a (diff)
Fixed #37016 -- Avoided propagating invalid arguments from When() to Q().
Diffstat (limited to 'tests')
-rw-r--r--tests/expressions_case/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/expressions_case/tests.py b/tests/expressions_case/tests.py
index 8704a7b991..1fde24f149 100644
--- a/tests/expressions_case/tests.py
+++ b/tests/expressions_case/tests.py
@@ -1668,6 +1668,11 @@ class CaseWhenTests(SimpleTestCase):
with self.assertRaisesMessage(TypeError, msg):
When()
+ def test_when_rejects_invalid_arguments(self):
+ msg = "The following kwargs are invalid: '_connector', '_negated'"
+ with self.assertRaisesMessage(TypeError, msg):
+ When(_negated=True, _connector="evil")
+
def test_empty_q_object(self):
msg = "An empty Q() can't be used as a When() condition."
with self.assertRaisesMessage(ValueError, msg):