mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Refs #23919 -- Stopped inheriting from object to define new style classes.
This commit is contained in:
parent
a556396339
commit
cecc079168
293 changed files with 512 additions and 514 deletions
|
@ -72,7 +72,7 @@ class FunctionTests(SimpleTestCase):
|
|||
self.assertEqual(floatformat(nan), str(nan))
|
||||
|
||||
def test_float_dunder_method(self):
|
||||
class FloatWrapper(object):
|
||||
class FloatWrapper:
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ class FunctionTests(SimpleTestCase):
|
|||
)
|
||||
|
||||
def test_ulitem(self):
|
||||
class ULItem(object):
|
||||
class ULItem:
|
||||
def __init__(self, title):
|
||||
self.title = title
|
||||
|
||||
|
@ -113,7 +113,7 @@ class FunctionTests(SimpleTestCase):
|
|||
)
|
||||
|
||||
def test_ulitem_autoescape_off(self):
|
||||
class ULItem(object):
|
||||
class ULItem:
|
||||
def __init__(self, title):
|
||||
self.title = title
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class CallableVariablesTests(TestCase):
|
|||
|
||||
def test_callable(self):
|
||||
|
||||
class Doodad(object):
|
||||
class Doodad:
|
||||
def __init__(self, value):
|
||||
self.num_calls = 0
|
||||
self.value = value
|
||||
|
@ -41,7 +41,7 @@ class CallableVariablesTests(TestCase):
|
|||
|
||||
def test_alters_data(self):
|
||||
|
||||
class Doodad(object):
|
||||
class Doodad:
|
||||
alters_data = True
|
||||
|
||||
def __init__(self, value):
|
||||
|
@ -68,7 +68,7 @@ class CallableVariablesTests(TestCase):
|
|||
|
||||
def test_do_not_call(self):
|
||||
|
||||
class Doodad(object):
|
||||
class Doodad:
|
||||
do_not_call_in_templates = True
|
||||
|
||||
def __init__(self, value):
|
||||
|
@ -100,7 +100,7 @@ class CallableVariablesTests(TestCase):
|
|||
# ``alters_data`` attribute will not make any difference in the
|
||||
# template system's behavior.
|
||||
|
||||
class Doodad(object):
|
||||
class Doodad:
|
||||
do_not_call_in_templates = True
|
||||
alters_data = True
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class VariableResolveLoggingTests(BaseTemplateLoggingTestCase):
|
|||
loglevel = logging.DEBUG
|
||||
|
||||
def test_log_on_variable_does_not_exist_silent(self):
|
||||
class TestObject(object):
|
||||
class TestObject:
|
||||
class SilentDoesNotExist(Exception):
|
||||
silent_variable_failure = True
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ class OtherClass:
|
|||
return 'OtherClass.method'
|
||||
|
||||
|
||||
class TestObj(object):
|
||||
class TestObj:
|
||||
def is_true(self):
|
||||
return True
|
||||
|
||||
|
@ -153,12 +153,12 @@ class TestObj(object):
|
|||
raise ShouldNotExecuteException()
|
||||
|
||||
|
||||
class SilentGetItemClass(object):
|
||||
class SilentGetItemClass:
|
||||
def __getitem__(self, key):
|
||||
raise SomeException
|
||||
|
||||
|
||||
class SilentAttrClass(object):
|
||||
class SilentAttrClass:
|
||||
def b(self):
|
||||
raise SomeException
|
||||
b = property(b)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue