1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Refs #33651 -- Removed Prefetch.get_current_queryset() and get_prefetch_queryset() per deprecation timeline.

This commit is contained in:
Sarah Boyce
2024-12-12 18:12:23 +01:00
parent 55f71b195b
commit 817bc5800b
9 changed files with 21 additions and 252 deletions

View File

@@ -1,6 +1,5 @@
from django.db import IntegrityError, connection, transaction
from django.test import TestCase
from django.utils.deprecation import RemovedInDjango60Warning
from .models import (
Bar,
@@ -606,16 +605,6 @@ class OneToOneTests(TestCase):
self.b1.save()
self.assertEqual(self.b1.place, self.p2)
def test_get_prefetch_queryset_warning(self):
places = Place.objects.all()
msg = (
"get_prefetch_queryset() is deprecated. Use get_prefetch_querysets() "
"instead."
)
with self.assertWarnsMessage(RemovedInDjango60Warning, msg) as ctx:
Place.bar.get_prefetch_queryset(places)
self.assertEqual(ctx.filename, __file__)
def test_get_prefetch_querysets_invalid_querysets_length(self):
places = Place.objects.all()
msg = (