  @skipUnless(HAS_GDAL, "LayerMapRouterTest needs GDAL support")
  @skipUnlessDBFeature("gis_enabled")
  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)
          self.assertEqual(lm.using, 'other')
 
</s> remove     def setUp(self):
        # Make the 'other' database appear to be a replica of the 'default'
        self.old_routers = router.routers
        router.routers = [TestRouter()]

    def tearDown(self):
        # Restore the 'other' database as an independent database
        router.routers = self.old_routers

 </s> add  </s> remove     def setUp(self):
        # Make the 'other' database appear to be a replica of the 'default'
        self.old_routers = router.routers
        router.routers = [MigrateNothingRouter()]

    def tearDown(self):
        # Restore the 'other' database as an independent database
        router.routers = self.old_routers

 </s> add  </s> remove     def setUp(self):
        self._old_routers = router.routers
        router.routers = [TestRouter()]

    def tearDown(self):
        router.routers = self._old_routers
 </s> add  </s> remove     def tearDown(self):
        router.routers = self.old_routers

 </s> add 
  @skipUnless(HAS_GDAL, "LayerMapRouterTest needs GDAL support")
  @skipUnlessDBFeature("gis_enabled")
  class LayerMapRouterTest(TestCase):
  







      @unittest.skipUnless(len(settings.DATABASES) > 1, 'multiple databases required')
      def test_layermapping_default_db(self):
          lm = LayerMapping(City, city_shp, city_mapping)
          self.assertEqual(lm.using, 'other')
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep
 Replaced router.routers usage with override_settings(DATABASE_ROUTERS); refs #23933. 
django/contrib/gis/tests/layermap/tests.py