diff options
| author | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-12-12 18:12:23 +0100 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-01-15 22:28:37 +0100 |
| commit | 817bc5800b40bcc74534de5e5176919cb826494f (patch) | |
| tree | 9312fa61d74417bb99dbcddfc563688c49e7136f /tests/contenttypes_tests | |
| parent | 55f71b195b76f4806bd1cd928f85d9c72aa935f4 (diff) | |
Refs #33651 -- Removed Prefetch.get_current_queryset() and get_prefetch_queryset() per deprecation timeline.
Diffstat (limited to 'tests/contenttypes_tests')
| -rw-r--r-- | tests/contenttypes_tests/test_fields.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/contenttypes_tests/test_fields.py b/tests/contenttypes_tests/test_fields.py index fc49d59b27..764b9fa7db 100644 --- a/tests/contenttypes_tests/test_fields.py +++ b/tests/contenttypes_tests/test_fields.py @@ -5,7 +5,6 @@ from django.contrib.contenttypes.prefetch import GenericPrefetch from django.db import models from django.test import TestCase from django.test.utils import isolate_apps -from django.utils.deprecation import RemovedInDjango60Warning from .models import Answer, Post, Question @@ -99,29 +98,6 @@ class DeferredGenericRelationTests(TestCase): obj.question -class GetPrefetchQuerySetDeprecation(TestCase): - def test_generic_relation_warning(self): - Question.objects.create(text="test") - questions = Question.objects.all() - msg = ( - "get_prefetch_queryset() is deprecated. Use get_prefetch_querysets() " - "instead." - ) - with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx: - questions[0].answer_set.get_prefetch_queryset(questions) - self.assertEqual(ctx.filename, __file__) - - def test_generic_foreign_key_warning(self): - answers = Answer.objects.all() - msg = ( - "get_prefetch_queryset() is deprecated. Use get_prefetch_querysets() " - "instead." - ) - with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx: - Answer.question.get_prefetch_queryset(answers) - self.assertEqual(ctx.filename, __file__) - - class GetPrefetchQuerySetsTests(TestCase): def test_duplicate_querysets(self): question = Question.objects.create(text="What is your name?") |
