summaryrefslogtreecommitdiff
path: root/tests/model_indexes
diff options
context:
space:
mode:
authorDaniyal <abbasi.daniyal98@gmail.com>2021-03-24 11:15:08 +0530
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-07-15 11:43:33 +0200
commitf479df7f8d03ab767bb5e5d655243191087d6432 (patch)
treebf6f248ad7938a0d9f77ea616a59fba2d5a8befb /tests/model_indexes
parent08f077888548a951f01b454d0db08d9407f7f0aa (diff)
downloaddjango-f479df7f8d03ab767bb5e5d655243191087d6432.tar.gz
Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.db.models.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'tests/model_indexes')
-rw-r--r--tests/model_indexes/tests.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/model_indexes/tests.py b/tests/model_indexes/tests.py
index 46f769cddc..95dec7ef48 100644
--- a/tests/model_indexes/tests.py
+++ b/tests/model_indexes/tests.py
@@ -173,8 +173,11 @@ class SimpleIndexesTests(SimpleTestCase):
# suffix can't be longer than 3 characters.
long_field_index.suffix = 'suff'
- msg = 'Index too long for multiple database support. Is self.suffix longer than 3 characters?'
- with self.assertRaisesMessage(AssertionError, msg):
+ msg = (
+ 'Index too long for multiple database support. Is self.suffix '
+ 'longer than 3 characters?'
+ )
+ with self.assertRaisesMessage(ValueError, msg):
long_field_index.set_name_with_model(Book)
@isolate_apps('model_indexes')