mirror of
https://github.com/django/django.git
synced 2025-08-01 09:32:50 +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:
parent
5bd585a82d
commit
fa58450a9a
10 changed files with 149 additions and 13 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue