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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user