summaryrefslogtreecommitdiff
path: root/tests/contenttypes_tests
diff options
context:
space:
mode:
authorsobolevn <mail@sobolevn.me>2024-05-03 11:40:50 +0300
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-05-04 11:30:36 +0200
commit9a27c76021f934201cccf12215514a3091325ec8 (patch)
tree962951d4cf8d544b33561dc54f724b4bd36acc26 /tests/contenttypes_tests
parent32d163e680817e202e0def3fbb70d2450b02cffd (diff)
Fixed #35426 -- Updated querysets to be a required argument of GenericPrefetch.
Diffstat (limited to 'tests/contenttypes_tests')
-rw-r--r--tests/contenttypes_tests/test_models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/contenttypes_tests/test_models.py b/tests/contenttypes_tests/test_models.py
index 88f715ceff..799f1cc58c 100644
--- a/tests/contenttypes_tests/test_models.py
+++ b/tests/contenttypes_tests/test_models.py
@@ -331,6 +331,14 @@ class ContentTypesMultidbTests(TestCase):
class GenericPrefetchTests(TestCase):
+ def test_querysets_required(self):
+ msg = (
+ "GenericPrefetch.__init__() missing 1 required "
+ "positional argument: 'querysets'"
+ )
+ with self.assertRaisesMessage(TypeError, msg):
+ GenericPrefetch("question")
+
def test_values_queryset(self):
msg = "Prefetch querysets cannot use raw(), values(), and values_list()."
with self.assertRaisesMessage(ValueError, msg):