1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Refs #32508 -- Raised Type/ValueError instead of using "assert" in django.db.models.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
Daniyal
2021-03-24 11:15:08 +05:30
committed by Mariusz Felisiak
parent 08f0778885
commit f479df7f8d
20 changed files with 168 additions and 79 deletions

View File

@@ -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')