1
0
mirror of https://github.com/django/django.git synced 2025-10-27 15:46:10 +00:00

[5.0.x] Applied Black's 2024 stable style.

https://github.com/psf/black/releases/tag/24.1.0

Backport of 305757aec1 from main
This commit is contained in:
Mariusz Felisiak
2024-01-26 12:45:07 +01:00
parent 86dd89e623
commit 0379e7532f
234 changed files with 804 additions and 599 deletions

View File

@@ -2027,15 +2027,18 @@ class ConstraintsTests(TestCase):
self.assertEqual(
Model.check(databases=self.databases),
[
Error(
"'constraints' refers to the nonexistent field 'missing_field'.",
obj=Model,
id="models.E012",
),
]
if connection.features.supports_table_check_constraints
else [],
(
[
Error(
"'constraints' refers to the nonexistent field "
"'missing_field'.",
obj=Model,
id="models.E012",
),
]
if connection.features.supports_table_check_constraints
else []
),
)
@skipUnlessDBFeature("supports_table_check_constraints")
@@ -2381,15 +2384,18 @@ class ConstraintsTests(TestCase):
self.assertEqual(
Model.check(databases=self.databases),
[
Error(
"'constraints' refers to the nonexistent field 'missing_field'.",
obj=Model,
id="models.E012",
),
]
if connection.features.supports_partial_indexes
else [],
(
[
Error(
"'constraints' refers to the nonexistent field "
"'missing_field'.",
obj=Model,
id="models.E012",
),
]
if connection.features.supports_partial_indexes
else []
),
)
def test_unique_constraint_condition_pointing_to_joined_fields(self):
@@ -2409,15 +2415,17 @@ class ConstraintsTests(TestCase):
self.assertEqual(
Model.check(databases=self.databases),
[
Error(
"'constraints' refers to the joined field 'parent__age__lt'.",
obj=Model,
id="models.E041",
)
]
if connection.features.supports_partial_indexes
else [],
(
[
Error(
"'constraints' refers to the joined field 'parent__age__lt'.",
obj=Model,
id="models.E041",
)
]
if connection.features.supports_partial_indexes
else []
),
)
def test_unique_constraint_pointing_to_reverse_o2o(self):
@@ -2436,15 +2444,17 @@ class ConstraintsTests(TestCase):
self.assertEqual(
Model.check(databases=self.databases),
[
Error(
"'constraints' refers to the nonexistent field 'model'.",
obj=Model,
id="models.E012",
),
]
if connection.features.supports_partial_indexes
else [],
(
[
Error(
"'constraints' refers to the nonexistent field 'model'.",
obj=Model,
id="models.E012",
),
]
if connection.features.supports_partial_indexes
else []
),
)
def test_deferrable_unique_constraint(self):