diff options
| author | wrwrwr <git@wr.waw.pl> | 2014-11-29 18:09:40 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-12-01 11:34:15 -0500 |
| commit | 9136ceb6fb8225625631671147ff70c1fcfbbcdc (patch) | |
| tree | fe846d89151c87b7474fbe2ef8cdedcde578dba4 /django | |
| parent | e6f19ec3223ba7c398aea515c5e0f8b93e6f4359 (diff) | |
Replaced router.routers usage with override_settings(DATABASE_ROUTERS); refs #23933.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/tests/layermap/tests.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/django/contrib/gis/tests/layermap/tests.py b/django/contrib/gis/tests/layermap/tests.py index b9b1404b3c..45709e30ce 100644 --- a/django/contrib/gis/tests/layermap/tests.py +++ b/django/contrib/gis/tests/layermap/tests.py @@ -8,9 +8,9 @@ import unittest from unittest import skipUnless from django.contrib.gis.gdal import HAS_GDAL -from django.db import connection, router +from django.db import connection from django.conf import settings -from django.test import TestCase, skipUnlessDBFeature +from django.test import TestCase, override_settings, skipUnlessDBFeature from django.utils._os import upath if HAS_GDAL: @@ -328,15 +328,9 @@ class OtherRouter(object): @skipUnless(HAS_GDAL, "LayerMapRouterTest needs GDAL support") @skipUnlessDBFeature("gis_enabled") +@override_settings(DATABASE_ROUTERS=[OtherRouter()]) class LayerMapRouterTest(TestCase): - def setUp(self): - self.old_routers = router.routers - router.routers = [OtherRouter()] - - def tearDown(self): - router.routers = self.old_routers - @unittest.skipUnless(len(settings.DATABASES) > 1, 'multiple databases required') def test_layermapping_default_db(self): lm = LayerMapping(City, city_shp, city_mapping) |
