mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #25063 -- Added path to makemigration's output of migration file.
This commit is contained in:
parent
e090070761
commit
99a1265a39
6 changed files with 24 additions and 4 deletions
|
@ -1009,6 +1009,18 @@ class MakeMigrationsTests(MigrationTestBase):
|
|||
with self.temporary_migration_module(module="migrations.test_migrations_no_changes"):
|
||||
call_command("makemigrations", "--check", "migrations", verbosity=0)
|
||||
|
||||
def test_makemigrations_migration_path_output(self):
|
||||
"""
|
||||
makemigrations should print the relative paths to the migrations unless
|
||||
they are outside of the current tree, in which case the absolute path
|
||||
should be shown.
|
||||
"""
|
||||
out = six.StringIO()
|
||||
apps.register_model('migrations', UnicodeModel)
|
||||
with self.temporary_migration_module() as migration_dir:
|
||||
call_command("makemigrations", "migrations", stdout=out)
|
||||
self.assertIn(os.path.join(migration_dir, '0001_initial.py'), out.getvalue())
|
||||
|
||||
|
||||
class SquashMigrationsTests(MigrationTestBase):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue