mirror of
https://github.com/django/django.git
synced 2025-07-12 07:45:11 +00:00
Refs #33829 -- Added violation_error_message to constraints' __repr__().
This commit is contained in:
parent
dcd9746983
commit
51c9bb7cd1
4 changed files with 58 additions and 3 deletions
|
@ -386,6 +386,17 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
|
|||
"(OpClass(F(datespan), name=range_ops), '-|-')] "
|
||||
"name='exclude_overlapping'>",
|
||||
)
|
||||
constraint = ExclusionConstraint(
|
||||
name="exclude_overlapping",
|
||||
expressions=[(F("datespan"), RangeOperators.ADJACENT_TO)],
|
||||
violation_error_message="Overlapping must be excluded",
|
||||
)
|
||||
self.assertEqual(
|
||||
repr(constraint),
|
||||
"<ExclusionConstraint: index_type='GIST' expressions=["
|
||||
"(F(datespan), '-|-')] name='exclude_overlapping' "
|
||||
"violation_error_message='Overlapping must be excluded'>",
|
||||
)
|
||||
|
||||
def test_eq(self):
|
||||
constraint_1 = ExclusionConstraint(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue