mirror of https://github.com/django/django.git
Fixed a couple of allow_migrate routers in tests.
This reverts commit 88e6fbb2e3
.
This commit is contained in:
parent
5131aec7d2
commit
1b73c764d4
|
@ -92,14 +92,13 @@ class SQLCommandsTestCase(TestCase):
|
||||||
|
|
||||||
|
|
||||||
class TestRouter(object):
|
class TestRouter(object):
|
||||||
def allow_migrate(self, db, model):
|
def allow_migrate(self, db, app_label, **hints):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
@override_settings(DATABASE_ROUTERS=[TestRouter()])
|
@override_settings(DATABASE_ROUTERS=[TestRouter()])
|
||||||
class SQLCommandsRouterTestCase(TestCase):
|
class SQLCommandsRouterTestCase(TestCase):
|
||||||
|
|
||||||
@ignore_warnings(category=RemovedInDjango20Warning)
|
|
||||||
def test_router_honored(self):
|
def test_router_honored(self):
|
||||||
app_config = apps.get_app_config('commands_sql')
|
app_config = apps.get_app_config('commands_sql')
|
||||||
for sql_command in (sql_all, sql_create, sql_delete, sql_indexes, sql_destroy_indexes):
|
for sql_command in (sql_all, sql_create, sql_delete, sql_indexes, sql_destroy_indexes):
|
||||||
|
|
|
@ -1524,7 +1524,7 @@ class AntiPetRouter(object):
|
||||||
# A router that only expresses an opinion on migrate,
|
# A router that only expresses an opinion on migrate,
|
||||||
# passing pets to the 'other' database
|
# passing pets to the 'other' database
|
||||||
|
|
||||||
def allow_migrate(self, db, app_label, model_name, **hints):
|
def allow_migrate(self, db, app_label, model_name=None, **hints):
|
||||||
if db == 'other':
|
if db == 'other':
|
||||||
return model_name == 'pet'
|
return model_name == 'pet'
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue