mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #31703 -- Added Migration.suggest_name() test for initial migration with multiple CreateModels.
This commit is contained in:
parent
bce180dd05
commit
01195c4a83
@ -2505,6 +2505,17 @@ class MigrationSuggestNameTests(SimpleTestCase):
|
||||
migration = Migration('0001_initial', 'test_app')
|
||||
self.assertEqual(migration.suggest_name(), 'animal_person')
|
||||
|
||||
def test_two_create_models_with_initial_true(self):
|
||||
class Migration(migrations.Migration):
|
||||
initial = True
|
||||
operations = [
|
||||
migrations.CreateModel('Person', fields=[]),
|
||||
migrations.CreateModel('Animal', fields=[]),
|
||||
]
|
||||
|
||||
migration = Migration('0001_initial', 'test_app')
|
||||
self.assertEqual(migration.suggest_name(), 'animal_person')
|
||||
|
||||
def test_none_name(self):
|
||||
class Migration(migrations.Migration):
|
||||
operations = [migrations.RunSQL('SELECT 1 FROM person;')]
|
||||
|
Loading…
Reference in New Issue
Block a user