1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Refs #34355 -- Removed support for positional arguments in BaseConstraint per deprecation timeline.

This commit is contained in:
Sarah Boyce
2024-12-12 16:32:08 +01:00
parent 810edfd742
commit b5a6c93a18
4 changed files with 2 additions and 37 deletions

View File

@@ -103,11 +103,6 @@ class BaseConstraintTests(SimpleTestCase):
},
)
def test_deprecation(self):
msg = "Passing positional arguments to BaseConstraint is deprecated."
with self.assertRaisesMessage(RemovedInDjango60Warning, msg):
BaseConstraint("name", "violation error message")
def test_name_required(self):
msg = (
"BaseConstraint.__init__() missing 1 required keyword-only argument: 'name'"
@@ -115,11 +110,6 @@ class BaseConstraintTests(SimpleTestCase):
with self.assertRaisesMessage(TypeError, msg):
BaseConstraint()
@ignore_warnings(category=RemovedInDjango60Warning)
def test_positional_arguments(self):
c = BaseConstraint("name", "custom %(name)s message")
self.assertEqual(c.get_violation_error_message(), "custom name message")
class CheckConstraintTests(TestCase):
def test_eq(self):