diff options
author | can <cansarigol@derinbilgi.com.tr> | 2019-07-04 19:21:50 +0300 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-07-05 09:30:21 +0200 |
commit | 53209f78302a639032afabf5326d28d4ddd9d03c (patch) | |
tree | 1fc04d7c676950946c26d1f760d0badb2f761e6b /tests/model_indexes | |
parent | f197c3dd9130b18397022605c27ffe5755f329d7 (diff) | |
download | django-53209f78302a639032afabf5326d28d4ddd9d03c.tar.gz |
Fixed #30613 -- Moved index name validation to system checks.
Diffstat (limited to 'tests/model_indexes')
-rw-r--r-- | tests/model_indexes/tests.py | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/tests/model_indexes/tests.py b/tests/model_indexes/tests.py index 60fc0560e4..5180d8cee9 100644 --- a/tests/model_indexes/tests.py +++ b/tests/model_indexes/tests.py @@ -63,20 +63,6 @@ class SimpleIndexesTests(SimpleTestCase): with self.assertRaisesMessage(ValueError, 'Index.condition must be a Q instance.'): models.Index(condition='invalid', name='long_book_idx') - def test_max_name_length(self): - msg = 'Index names cannot be longer than 30 characters.' - with self.assertRaisesMessage(ValueError, msg): - models.Index(fields=['title'], name='looooooooooooong_index_name_idx') - - def test_name_constraints(self): - msg = 'Index names cannot start with an underscore (_).' - with self.assertRaisesMessage(ValueError, msg): - models.Index(fields=['title'], name='_name_starting_with_underscore') - - msg = 'Index names cannot start with a number (0-9).' - with self.assertRaisesMessage(ValueError, msg): - models.Index(fields=['title'], name='5name_starting_with_number') - def test_name_auto_generation(self): index = models.Index(fields=['author']) index.set_name_with_model(Book) |