summaryrefslogtreecommitdiff
path: root/tests/model_indexes
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-06-17 10:32:43 +0200
committerGitHub <noreply@github.com>2020-06-17 10:32:43 +0200
commit82da72b74851808c08ec98fe609efe52609f29ad (patch)
tree9f2125907b0984960feaaebfe214dd20b250d2cf /tests/model_indexes
parent1621f06051c94665f2edf492c10316875896e7eb (diff)
downloaddjango-82da72b74851808c08ec98fe609efe52609f29ad.tar.gz
Refs #28077 -- Added opclasses to Index.__repr__().
This also removes unnecessary commas between attributes.
Diffstat (limited to 'tests/model_indexes')
-rw-r--r--tests/model_indexes/tests.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/model_indexes/tests.py b/tests/model_indexes/tests.py
index ff3c6c73c7..93ac47130a 100644
--- a/tests/model_indexes/tests.py
+++ b/tests/model_indexes/tests.py
@@ -22,12 +22,22 @@ class SimpleIndexesTests(SimpleTestCase):
name='include_idx',
include=['author', 'pages'],
)
+ opclasses_index = models.Index(
+ fields=['headline', 'body'],
+ name='opclasses_idx',
+ opclasses=['varchar_pattern_ops', 'text_pattern_ops'],
+ )
self.assertEqual(repr(index), "<Index: fields='title'>")
self.assertEqual(repr(multi_col_index), "<Index: fields='title, author'>")
- self.assertEqual(repr(partial_index), "<Index: fields='title', condition=(AND: ('pages__gt', 400))>")
+ self.assertEqual(repr(partial_index), "<Index: fields='title' condition=(AND: ('pages__gt', 400))>")
self.assertEqual(
repr(covering_index),
- "<Index: fields='title', include='author, pages'>",
+ "<Index: fields='title' include='author, pages'>",
+ )
+ self.assertEqual(
+ repr(opclasses_index),
+ "<Index: fields='headline, body' "
+ "opclasses='varchar_pattern_ops, text_pattern_ops'>",
)
def test_eq(self):