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
@@ -124,7 +124,7 @@ class PaginationTests(unittest.TestCase):
|
||||
self.assertEqual(paginator.validate_number(1), 1)
|
||||
|
||||
def test_paginate_misc_classes(self):
|
||||
class CountContainer(object):
|
||||
class CountContainer:
|
||||
def count(self):
|
||||
return 42
|
||||
# Paginator can be passed other objects with a count() method.
|
||||
@@ -134,7 +134,7 @@ class PaginationTests(unittest.TestCase):
|
||||
self.assertEqual([1, 2, 3, 4, 5], list(paginator.page_range))
|
||||
|
||||
# Paginator can be passed other objects that implement __len__.
|
||||
class LenContainer(object):
|
||||
class LenContainer:
|
||||
def __len__(self):
|
||||
return 42
|
||||
paginator = Paginator(LenContainer(), 10)
|
||||
|
||||
Reference in New Issue
Block a user