summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNiels Van Och <niels.vanoch@gmail.com>2015-11-07 14:43:06 +0100
committerTim Graham <timograham@gmail.com>2015-12-18 11:20:00 -0500
commit99a1265a394cb50f5b5aa9046f7b6cd230bc25cf (patch)
tree79a1063b1731ddeaba4df9ce7df9fc3025e79acf /tests
parente09007076138d71d9605c4acd94acdf29cbc87e7 (diff)
Fixed #25063 -- Added path to makemigration's output of migration file.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_commands.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index a95d26b071..1ef749e0b3 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -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):
"""