mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more consistent.
This commit is contained in:
parent
7c18b22e2f
commit
87acbf0631
8 changed files with 84 additions and 42 deletions
|
@ -282,8 +282,8 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
|
|||
)
|
||||
self.assertEqual(
|
||||
repr(constraint),
|
||||
"<ExclusionConstraint: index_type=GIST, expressions=["
|
||||
"(F(datespan), '&&'), (F(room), '=')]>",
|
||||
"<ExclusionConstraint: index_type='GIST' expressions=["
|
||||
"(F(datespan), '&&'), (F(room), '=')] name='exclude_overlapping'>",
|
||||
)
|
||||
constraint = ExclusionConstraint(
|
||||
name='exclude_overlapping',
|
||||
|
@ -293,8 +293,9 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
|
|||
)
|
||||
self.assertEqual(
|
||||
repr(constraint),
|
||||
"<ExclusionConstraint: index_type=SPGiST, expressions=["
|
||||
"(F(datespan), '-|-')], condition=(AND: ('cancelled', False))>",
|
||||
"<ExclusionConstraint: index_type='SPGiST' expressions=["
|
||||
"(F(datespan), '-|-')] name='exclude_overlapping' "
|
||||
"condition=(AND: ('cancelled', False))>",
|
||||
)
|
||||
constraint = ExclusionConstraint(
|
||||
name='exclude_overlapping',
|
||||
|
@ -303,8 +304,9 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
|
|||
)
|
||||
self.assertEqual(
|
||||
repr(constraint),
|
||||
"<ExclusionConstraint: index_type=GIST, expressions=["
|
||||
"(F(datespan), '-|-')], deferrable=Deferrable.IMMEDIATE>",
|
||||
"<ExclusionConstraint: index_type='GIST' expressions=["
|
||||
"(F(datespan), '-|-')] name='exclude_overlapping' "
|
||||
"deferrable=Deferrable.IMMEDIATE>",
|
||||
)
|
||||
constraint = ExclusionConstraint(
|
||||
name='exclude_overlapping',
|
||||
|
@ -313,8 +315,9 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
|
|||
)
|
||||
self.assertEqual(
|
||||
repr(constraint),
|
||||
"<ExclusionConstraint: index_type=GIST, expressions=["
|
||||
"(F(datespan), '-|-')], include=('cancelled', 'room')>",
|
||||
"<ExclusionConstraint: index_type='GIST' expressions=["
|
||||
"(F(datespan), '-|-')] name='exclude_overlapping' "
|
||||
"include=('cancelled', 'room')>",
|
||||
)
|
||||
constraint = ExclusionConstraint(
|
||||
name='exclude_overlapping',
|
||||
|
@ -323,8 +326,9 @@ class ExclusionConstraintTests(PostgreSQLTestCase):
|
|||
)
|
||||
self.assertEqual(
|
||||
repr(constraint),
|
||||
"<ExclusionConstraint: index_type=GIST, expressions=["
|
||||
"(F(datespan), '-|-')], opclasses=['range_ops']>",
|
||||
"<ExclusionConstraint: index_type='GIST' expressions=["
|
||||
"(F(datespan), '-|-')] name='exclude_overlapping' "
|
||||
"opclasses=['range_ops']>",
|
||||
)
|
||||
|
||||
def test_eq(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue