mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #28478 -- Prevented database feature based skipping on tests disallowing queries.
Database features may require a connection to be established to determine whether or not they are enabled.
This commit is contained in:
committed by
Tim Graham
parent
f5b635086a
commit
b181aba7dd
@@ -1,13 +1,13 @@
|
||||
from django.conf import settings
|
||||
from django.db import connection, models
|
||||
from django.db.models.query_utils import Q
|
||||
from django.test import SimpleTestCase, skipUnlessDBFeature
|
||||
from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
|
||||
from django.test.utils import isolate_apps
|
||||
|
||||
from .models import Book, ChildModel1, ChildModel2
|
||||
|
||||
|
||||
class IndexesTests(SimpleTestCase):
|
||||
class SimpleIndexesTests(SimpleTestCase):
|
||||
|
||||
def test_suffix(self):
|
||||
self.assertEqual(models.Index.suffix, 'idx')
|
||||
@@ -156,6 +156,9 @@ class IndexesTests(SimpleTestCase):
|
||||
index_names = [index.name for index in ChildModel2._meta.indexes]
|
||||
self.assertEqual(index_names, ['model_index_name_b6c374_idx'])
|
||||
|
||||
|
||||
class IndexesTests(TestCase):
|
||||
|
||||
@skipUnlessDBFeature('supports_tablespaces')
|
||||
def test_db_tablespace(self):
|
||||
editor = connection.schema_editor()
|
||||
|
||||
Reference in New Issue
Block a user