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:
committed by
Mariusz Felisiak
parent
08f0778885
commit
f479df7f8d
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user