mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #31468 -- Allowed specifying migration filename in Operation.
This adds also suggested filename for many built-in operations.
This commit is contained in:
committed by
Mariusz Felisiak
parent
5bd585a82d
commit
fa58450a9a
@@ -2495,6 +2495,11 @@ class AutodetectorSuggestNameTests(SimpleTestCase):
|
||||
]
|
||||
self.assertEqual(MigrationAutodetector.suggest_name(ops), 'animal_person')
|
||||
|
||||
def test_none_name(self):
|
||||
ops = [migrations.RunSQL('SELECT 1 FROM person;')]
|
||||
suggest_name = MigrationAutodetector.suggest_name(ops)
|
||||
self.assertIs(suggest_name.startswith('auto_'), True)
|
||||
|
||||
def test_auto(self):
|
||||
suggest_name = MigrationAutodetector.suggest_name([])
|
||||
self.assertIs(suggest_name.startswith('auto_'), True)
|
||||
|
||||
Reference in New Issue
Block a user