diff options
| author | Tim Graham <timograham@gmail.com> | 2026-01-30 21:25:17 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2026-01-31 16:26:27 +0100 |
| commit | bb8c14b4660ca0a35f0af73e8f3a671237860571 (patch) | |
| tree | ee73c3b7a302061960b9bf99eab2354db6f6d22b /tests/schema/tests.py | |
| parent | 4a52533329a03207c1c4592a13fbb12b9ec5ef9e (diff) | |
Added supports_expression_indexes skip to nulls_distinct test.
Diffstat (limited to 'tests/schema/tests.py')
| -rw-r--r-- | tests/schema/tests.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/schema/tests.py b/tests/schema/tests.py index cbc5f57eb9..024e68f2b3 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -3805,8 +3805,14 @@ class SchemaTests(TransactionTestCase): with self.assertRaises(DatabaseError): editor.add_constraint(Author, constraint) - @skipUnlessDBFeature("supports_nulls_distinct_unique_constraints") + @skipUnlessDBFeature( + "supports_expression_indexes", "supports_nulls_distinct_unique_constraints" + ) def test_unique_constraint_index_nulls_distinct(self): + """ + For a UniqueConstraint with expressions, the backend executes: + CREATE UNIQUE INDEX ... + """ with connection.schema_editor() as editor: editor.create_model(Author) nulls_distinct = UniqueConstraint( @@ -3831,6 +3837,10 @@ class SchemaTests(TransactionTestCase): @skipUnlessDBFeature("supports_nulls_distinct_unique_constraints") def test_unique_constraint_nulls_distinct(self): + """ + For UniqueConstraint(fields=...), the backend executes: + ALTER TABLE "schema_author" ADD CONSTRAINT ... + """ with connection.schema_editor() as editor: editor.create_model(Author) constraint = UniqueConstraint( |
