diff options
author | Hannes Ljungberg <hannes.ljungberg@gmail.com> | 2021-02-19 12:16:24 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-02-19 20:25:11 +0100 |
commit | 87acbf063156ebb3fec3d35ef139895335061e0b (patch) | |
tree | 16e449178666825bc507d0701220e150aa9f8643 /tests/postgres_tests | |
parent | 7c18b22e2fa70aa8dcfadb33beb17933abdf7ee4 (diff) | |
download | django-87acbf063156ebb3fec3d35ef139895335061e0b.tar.gz |
Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more consistent.
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r-- | tests/postgres_tests/test_constraints.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/postgres_tests/test_constraints.py b/tests/postgres_tests/test_constraints.py index 1bf52d0cc0..80c2bb77b6 100644 --- a/tests/postgres_tests/test_constraints.py +++ b/tests/postgres_tests/test_constraints.py @@ -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): |