summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-02-12 07:56:49 -0500
committerTim Graham <timograham@gmail.com>2015-02-12 07:56:49 -0500
commit0c9e006d5fddfe470553d792e2ecee02f467f2a8 (patch)
treeb0b5ddcde10b3780fdbf0ee61f9bbbd1d73a7d5c
parent1c1193da39c40a97a4bc8d6d5a8ac72e8060ced3 (diff)
[1.7.x] Fixed #24293 -- Skipped a contrib.sites test if multiple databases aren't setup.
-rw-r--r--django/contrib/sites/tests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/contrib/sites/tests.py b/django/contrib/sites/tests.py
index e59eb64e02..0e704763eb 100644
--- a/django/contrib/sites/tests.py
+++ b/django/contrib/sites/tests.py
@@ -1,9 +1,11 @@
from __future__ import unicode_literals
+import unittest
+
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
-from django.db import router
+from django.db import connections, router
from django.http import HttpRequest
from django.test import TestCase, modify_settings, override_settings
@@ -104,6 +106,7 @@ class CreateDefaultSiteTests(TestCase):
create_default_site(self.app_config, verbosity=0)
self.assertEqual(Site.objects.count(), 1)
+ @unittest.skipIf('other' not in connections, "Requires 'other' database connection.")
def test_multi_db(self):
"""
#16353, #16828 - The default site creation should respect db routing.