Refs #29182 -- Corrected SQLite's supports_atomic_references_rename feature flag.

This commit is contained in:
Simon Charette 2018-12-21 18:06:16 -05:00 committed by Tim Graham
parent e5b8626c0e
commit 25a0781a16
2 changed files with 6 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_transactions = True
atomic_transactions = False
can_rollback_ddl = True
supports_atomic_references_rename = Database.version_info >= (3, 26, 0)
supports_atomic_references_rename = Database.sqlite_version_info >= (3, 26, 0)
supports_paramstyle_pyformat = False
supports_sequence_reset = False
can_clone_databases = True

View File

@ -6,7 +6,9 @@ from django.db import connection, transaction
from django.db.models import Avg, StdDev, Sum, Variance
from django.db.models.fields import CharField
from django.db.utils import NotSupportedError
from django.test import TestCase, TransactionTestCase, override_settings
from django.test import (
TestCase, TransactionTestCase, override_settings, skipIfDBFeature,
)
from django.test.utils import isolate_apps
from ..models import Author, Item, Object, Square
@ -112,6 +114,7 @@ class SchemaTests(TransactionTestCase):
self.assertFalse(constraint_checks_enabled())
self.assertTrue(constraint_checks_enabled())
@skipIfDBFeature('supports_atomic_references_rename')
def test_field_rename_inside_atomic_block(self):
"""
NotImplementedError is raised when a model field rename is attempted
@ -129,6 +132,7 @@ class SchemaTests(TransactionTestCase):
with connection.schema_editor(atomic=True) as editor:
editor.alter_field(Author, Author._meta.get_field('name'), new_field)
@skipIfDBFeature('supports_atomic_references_rename')
def test_table_rename_inside_atomic_block(self):
"""
NotImplementedError is raised when a table rename is attempted inside