From 1c010ce41d6790b94d396aabe5c585cf1cc04b70 Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Fri, 5 Oct 2012 15:26:33 -0700 Subject: [PATCH] Skip `LayerMapRouterTest` if there are not multiple databases. --- django/contrib/gis/tests/layermap/tests.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/django/contrib/gis/tests/layermap/tests.py b/django/contrib/gis/tests/layermap/tests.py index 4912e645c2..7c1d99520d 100644 --- a/django/contrib/gis/tests/layermap/tests.py +++ b/django/contrib/gis/tests/layermap/tests.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import os +import unittest from copy import copy from decimal import Decimal @@ -9,6 +10,7 @@ from django.contrib.gis.tests.utils import mysql from django.contrib.gis.utils.layermapping import (LayerMapping, LayerMapError, InvalidDecimal, MissingForeignKey) from django.db import router +from django.conf import settings from django.test import TestCase from .models import ( @@ -308,6 +310,7 @@ class LayerMapRouterTest(TestCase): 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')