diff options
Diffstat (limited to 'tests/commands_sql')
| -rw-r--r-- | tests/commands_sql/tests.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/commands_sql/tests.py b/tests/commands_sql/tests.py index e9499d6b05..e381c031a5 100644 --- a/tests/commands_sql/tests.py +++ b/tests/commands_sql/tests.py @@ -7,8 +7,8 @@ from django.apps import apps from django.core.management.color import no_style from django.core.management.sql import (sql_create, sql_delete, sql_indexes, sql_destroy_indexes, sql_all) -from django.db import connections, DEFAULT_DB_ALIAS, router -from django.test import TestCase +from django.db import connections, DEFAULT_DB_ALIAS +from django.test import TestCase, override_settings from django.utils import six # See also initial_sql_regress for 'custom_sql_for_model' tests @@ -91,13 +91,8 @@ class TestRouter(object): return False +@override_settings(DATABASE_ROUTERS=[TestRouter()]) class SQLCommandsRouterTestCase(TestCase): - def setUp(self): - self._old_routers = router.routers - router.routers = [TestRouter()] - - def tearDown(self): - router.routers = self._old_routers def test_router_honored(self): app_config = apps.get_app_config('commands_sql') |
