mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #23919 -- Stopped inheriting from object to define new style classes.
This commit is contained in:
committed by
Claude Paroz
parent
a556396339
commit
cecc079168
@@ -105,7 +105,7 @@ class UtilsTests(SimpleTestCase):
|
||||
SIMPLE_FUNCTION = 'function'
|
||||
INSTANCE_ATTRIBUTE = 'attr'
|
||||
|
||||
class MockModelAdmin(object):
|
||||
class MockModelAdmin:
|
||||
def get_admin_value(self, obj):
|
||||
return ADMIN_METHOD
|
||||
|
||||
@@ -259,7 +259,7 @@ class UtilsTests(SimpleTestCase):
|
||||
)
|
||||
self.assertEqual(label_for_field('site_id', Article), 'Site id')
|
||||
|
||||
class MockModelAdmin(object):
|
||||
class MockModelAdmin:
|
||||
def test_from_model(self, obj):
|
||||
return "nothing"
|
||||
test_from_model.short_description = "not Really the Model"
|
||||
@@ -276,7 +276,7 @@ class UtilsTests(SimpleTestCase):
|
||||
def test_label_for_property(self):
|
||||
# NOTE: cannot use @property decorator, because of
|
||||
# AttributeError: 'property' object has no attribute 'short_description'
|
||||
class MockModelAdmin(object):
|
||||
class MockModelAdmin:
|
||||
def my_property(self):
|
||||
return "this if from property"
|
||||
my_property.short_description = 'property short description'
|
||||
|
||||
Reference in New Issue
Block a user