summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2025-09-24 15:56:03 -0400
committerNatalia <124304+nessita@users.noreply.github.com>2025-11-05 09:53:33 -0300
commit279f8b9557f0fef9790822b0c38164fc9dfcab2a (patch)
treeed46e50c94c6beb173365879f012014088fd6fd2 /tests
parent59ae82e67053d281ff4562a24bbba21299f0a7d4 (diff)
[4.2.x] Refs CVE-2025-64459 -- Avoided propagating invalid arguments to Q on dictionary expansion.
Backport of 3c3f46357718166069948625354b8315a8505262 from main.
Diffstat (limited to 'tests')
-rw-r--r--tests/queries/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/queries/tests.py b/tests/queries/tests.py
index b8488fef75..2290ea29bc 100644
--- a/tests/queries/tests.py
+++ b/tests/queries/tests.py
@@ -4490,6 +4490,14 @@ class TestInvalidValuesRelation(SimpleTestCase):
Annotation.objects.filter(tag__in=[123, "abc"])
+class TestInvalidFilterArguments(TestCase):
+ def test_filter_rejects_invalid_arguments(self):
+ school = School.objects.create()
+ msg = "The following kwargs are invalid: '_connector', '_negated'"
+ with self.assertRaisesMessage(TypeError, msg):
+ School.objects.filter(pk=school.pk, _negated=True, _connector="evil")
+
+
class TestTicket24605(TestCase):
def test_ticket_24605(self):
"""