diff --git a/django/contrib/postgres/indexes.py b/django/contrib/postgres/indexes.py index 42215dfdce..9ff66c2a00 100644 --- a/django/contrib/postgres/indexes.py +++ b/django/contrib/postgres/indexes.py @@ -17,16 +17,6 @@ class BrinIndex(Index): self.pages_per_range = pages_per_range super().__init__(fields, name) - def __repr__(self): - if self.pages_per_range is not None: - return '<%(name)s: fields=%(fields)s, pages_per_range=%(pages_per_range)s>' % { - 'name': self.__class__.__name__, - 'fields': "'{}'".format(', '.join(self.fields)), - 'pages_per_range': self.pages_per_range, - } - else: - return super().__repr__() - def deconstruct(self): path, args, kwargs = super().deconstruct() kwargs['pages_per_range'] = self.pages_per_range diff --git a/tests/postgres_tests/test_indexes.py b/tests/postgres_tests/test_indexes.py index e26d96f003..c3172f3a49 100644 --- a/tests/postgres_tests/test_indexes.py +++ b/tests/postgres_tests/test_indexes.py @@ -12,12 +12,6 @@ class BrinIndexTests(PostgreSQLTestCase): def test_suffix(self): self.assertEqual(BrinIndex.suffix, 'brin') - def test_repr(self): - index = BrinIndex(fields=['title'], pages_per_range=4) - another_index = BrinIndex(fields=['title']) - self.assertEqual(repr(index), "") - self.assertEqual(repr(another_index), "") - def test_not_eq(self): index = BrinIndex(fields=['title']) index_with_page_range = BrinIndex(fields=['title'], pages_per_range=16) @@ -58,10 +52,6 @@ class GinIndexTests(PostgreSQLTestCase): def test_suffix(self): self.assertEqual(GinIndex.suffix, 'gin') - def test_repr(self): - index = GinIndex(fields=['title']) - self.assertEqual(repr(index), "") - def test_eq(self): index = GinIndex(fields=['title']) same_index = GinIndex(fields=['title'])