summaryrefslogtreecommitdiff
path: root/tests/many_to_one
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-12-31 13:07:35 -0500
committerTim Graham <timograham@gmail.com>2017-01-17 20:52:04 -0500
commit631f4ab06112aca5bd6a57b81159048f936050bf (patch)
tree8df3dfea000b6776412faddffc9cdb0663264ebe /tests/many_to_one
parent60ca37d2e56e435521a4aa5ba56b1b11cb2a78e5 (diff)
downloaddjango-631f4ab06112aca5bd6a57b81159048f936050bf.tar.gz
Removed Manager.use_for_related_fields and Meta.manager_inheritance_from_future.
Per deprecation timeline. Refs ed0ff913c648b16c4471fc9a9441d1ee48cb5420.
Diffstat (limited to 'tests/many_to_one')
-rw-r--r--tests/many_to_one/tests.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/tests/many_to_one/tests.py b/tests/many_to_one/tests.py
index c0dd316f79..478a746669 100644
--- a/tests/many_to_one/tests.py
+++ b/tests/many_to_one/tests.py
@@ -4,8 +4,7 @@ from copy import deepcopy
from django.core.exceptions import FieldError, MultipleObjectsReturned
from django.db import models, transaction
from django.db.utils import IntegrityError
-from django.test import TestCase, ignore_warnings
-from django.utils.deprecation import RemovedInDjango20Warning
+from django.test import TestCase
from django.utils.translation import ugettext_lazy
from .models import (
@@ -577,7 +576,6 @@ class ManyToOneTests(TestCase):
with self.assertNumQueries(1):
self.assertEqual(th.child_set.count(), 0)
- @ignore_warnings(category=RemovedInDjango20Warning) # for use_for_related_fields deprecation
def test_related_object(self):
public_school = School.objects.create(is_public=True)
public_student = Student.objects.create(school=public_school)
@@ -595,17 +593,6 @@ class ManyToOneTests(TestCase):
# allow it.
self.assertEqual(private_student.school, private_school)
- # If the manager is marked "use_for_related_fields", it'll get used instead
- # of the "bare" queryset. Usually you'd define this as a property on the class,
- # but this approximates that in a way that's easier in tests.
- School._default_manager.use_for_related_fields = True
- try:
- private_student = Student.objects.get(pk=private_student.pk)
- with self.assertRaises(School.DoesNotExist):
- private_student.school
- finally:
- School._default_manager.use_for_related_fields = False
-
School._meta.base_manager_name = 'objects'
School._meta._expire_cache()
try: