Fixed #25063 -- Added path to makemigration's output of migration file.

This commit is contained in:
Niels Van Och 2015-11-07 14:43:06 +01:00 committed by Tim Graham
parent e090070761
commit 99a1265a39
6 changed files with 24 additions and 4 deletions

View file

@ -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):
"""