From b74b6736d061b896220c0971e3a060ec2f6be12b Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Wed, 26 Dec 2018 11:20:11 -0500 Subject: [PATCH] Refs #29547 -- Skipped an unsupported partial index test on older versions of SQLite. Follow up to e5b8626c0eb223cc3d643163882c5902c40ec972. --- django/db/backends/base/features.py | 1 + django/db/backends/sqlite3/features.py | 1 + tests/indexes/tests.py | 1 + 3 files changed, 3 insertions(+) diff --git a/django/db/backends/base/features.py b/django/db/backends/base/features.py index 7a71c76bd3..980d7e4d21 100644 --- a/django/db/backends/base/features.py +++ b/django/db/backends/base/features.py @@ -275,6 +275,7 @@ class BaseDatabaseFeatures: # Does the backend support partial indexes (CREATE INDEX ... WHERE ...)? supports_partial_indexes = True + supports_functions_in_partial_indexes = True def __init__(self, connection): self.connection = connection diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py index c57b8e1934..69a42cdc02 100644 --- a/django/db/backends/sqlite3/features.py +++ b/django/db/backends/sqlite3/features.py @@ -39,3 +39,4 @@ class DatabaseFeatures(BaseDatabaseFeatures): # reasonably performant way. supports_pragma_foreign_key_check = Database.sqlite_version_info >= (3, 20, 0) can_defer_constraint_checks = supports_pragma_foreign_key_check + supports_functions_in_partial_indexes = Database.sqlite_version_info >= (3, 15, 0) diff --git a/tests/indexes/tests.py b/tests/indexes/tests.py index ef81f6ab9b..7eb5dd89a9 100644 --- a/tests/indexes/tests.py +++ b/tests/indexes/tests.py @@ -303,6 +303,7 @@ class PartialIndexTests(TransactionTestCase): )) editor.remove_index(index=index, model=Article) + @skipUnlessDBFeature('supports_functions_in_partial_indexes') def test_multiple_conditions(self): with connection.schema_editor() as editor: index = Index(