mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +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
@@ -1529,7 +1529,7 @@ class AuthTestCase(TestCase):
|
||||
self.assertIn('"email": "alice@example.com"', command_output)
|
||||
|
||||
|
||||
class AntiPetRouter(object):
|
||||
class AntiPetRouter:
|
||||
# A router that only expresses an opinion on migrate,
|
||||
# passing pets to the 'other' database
|
||||
|
||||
@@ -1590,7 +1590,7 @@ class PickleQuerySetTestCase(TestCase):
|
||||
self.assertEqual(qs.db, pickle.loads(pickle.dumps(qs)).db)
|
||||
|
||||
|
||||
class DatabaseReceiver(object):
|
||||
class DatabaseReceiver:
|
||||
"""
|
||||
Used in the tests for the database argument in signals (#13552)
|
||||
"""
|
||||
@@ -1598,7 +1598,7 @@ class DatabaseReceiver(object):
|
||||
self._database = kwargs['using']
|
||||
|
||||
|
||||
class WriteToOtherRouter(object):
|
||||
class WriteToOtherRouter:
|
||||
"""
|
||||
A router that sends all writes to the other database.
|
||||
"""
|
||||
@@ -1698,7 +1698,7 @@ class SignalTests(TestCase):
|
||||
self.assertEqual(receiver._database, "other")
|
||||
|
||||
|
||||
class AttributeErrorRouter(object):
|
||||
class AttributeErrorRouter:
|
||||
"A router to test the exception handling of ConnectionRouter"
|
||||
def db_for_read(self, model, **hints):
|
||||
raise AttributeError
|
||||
@@ -1751,7 +1751,7 @@ class RouterAttributeErrorTestCase(TestCase):
|
||||
b.authors.set([p])
|
||||
|
||||
|
||||
class ModelMetaRouter(object):
|
||||
class ModelMetaRouter:
|
||||
"A router to ensure model arguments are real model classes"
|
||||
def db_for_write(self, model, **hints):
|
||||
if not hasattr(model, '_meta'):
|
||||
@@ -1785,7 +1785,7 @@ class RouterModelArgumentTestCase(TestCase):
|
||||
person.delete()
|
||||
|
||||
|
||||
class SyncOnlyDefaultDatabaseRouter(object):
|
||||
class SyncOnlyDefaultDatabaseRouter:
|
||||
def allow_migrate(self, db, app_label, **hints):
|
||||
return db == DEFAULT_DB_ALIAS
|
||||
|
||||
@@ -1828,7 +1828,7 @@ class RouterUsed(Exception):
|
||||
class RouteForWriteTestCase(TestCase):
|
||||
multi_db = True
|
||||
|
||||
class WriteCheckRouter(object):
|
||||
class WriteCheckRouter:
|
||||
def db_for_write(self, model, **hints):
|
||||
raise RouterUsed(mode=RouterUsed.WRITE, model=model, hints=hints)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user