Fix warnings

This is a little uncertain - while it does fix warnings I'm not sure the
removed assertion were actually useful in checking the behavior, and I'm
not certain how to recreate the assertion without using the depracated
path.
fix_request_path_info^2
Chris Glass 2020-08-14 16:32:18 +02:00
parent 24dd1fff2c
commit 76871e3863
1 changed files with 4 additions and 7 deletions

View File

@ -481,21 +481,22 @@ class PolymorphicTests(TransactionTestCase):
def test_foreignkey_field(self):
self.create_model2abcd()
object2a = Model2A.base_objects.get(field1="C1")
object2a = Model2A.objects.get(field1="C1")
self.assertEqual(object2a.model2b.__class__, Model2B)
object2b = Model2B.base_objects.get(field1="C1")
object2b = Model2B.objects.get(field1="C1")
self.assertEqual(object2b.model2c.__class__, Model2C)
def test_onetoone_field(self):
self.create_model2abcd()
# FIXME: We should not use base_objects here.
a = Model2A.base_objects.get(field1="C1")
b = One2OneRelatingModelDerived.objects.create(
one2one=a, field1="f1", field2="f2"
)
# this result is basically wrong, probably due to Django cacheing (we used base_objects), but should not be a problem
# FIXME: this result is basically wrong, probably due to Django cacheing (we used base_objects), but should not be a problem
self.assertEqual(b.one2one.__class__, Model2A)
self.assertEqual(b.one2one_id, b.one2one.id)
@ -808,7 +809,6 @@ class PolymorphicTests(TransactionTestCase):
self.assertIs(type(ModelWithMyManager.objects), MyManager)
self.assertIs(type(ModelWithMyManager._default_manager), MyManager)
self.assertIs(type(ModelWithMyManager.base_objects), models.Manager)
def test_user_defined_manager_as_secondary(self):
self.create_model2abcd()
@ -831,7 +831,6 @@ class PolymorphicTests(TransactionTestCase):
self.assertIs(
type(ModelWithMyManagerNoDefault._default_manager), PolymorphicManager
)
self.assertIs(type(ModelWithMyManagerNoDefault.base_objects), models.Manager)
def test_user_objects_manager_as_secondary(self):
self.create_model2abcd()
@ -841,7 +840,6 @@ class PolymorphicTests(TransactionTestCase):
self.assertIs(type(ModelWithMyManagerDefault.my_objects), MyManager)
self.assertIs(type(ModelWithMyManagerDefault.objects), PolymorphicManager)
self.assertIs(type(ModelWithMyManagerDefault._default_manager), MyManager)
self.assertIs(type(ModelWithMyManagerDefault.base_objects), models.Manager)
def test_user_defined_queryset_as_manager(self):
self.create_model2abcd()
@ -864,7 +862,6 @@ class PolymorphicTests(TransactionTestCase):
type(ModelWithMyManager2._default_manager).__name__,
"PolymorphicManagerFromMyManagerQuerySet",
)
self.assertIs(type(ModelWithMyManager2.base_objects), models.Manager)
def test_manager_inheritance(self):
# by choice of MRO, should be MyManager from MROBase1.