summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2018-09-28 09:56:40 -0400
committerGitHub <noreply@github.com>2018-09-28 09:56:40 -0400
commit4fc8fb7ddaad495d45d53df58b2d13115857b3c7 (patch)
tree5c9b45c06be3e73d4667f92305a9ea8acc2237ea
parent05c578bc1f6ab09ade17a29f79d7244b7acfb58f (diff)
Tested showmigrations with apps without migrations.
-rw-r--r--tests/migrations/test_commands.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 268e180697..33b85578af 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -373,6 +373,17 @@ class MigrateTests(MigrationTestBase):
call_command('migrate', 'migrations', '0003', fake=True, verbosity=0)
call_command('migrate', 'migrations', 'zero', verbosity=0)
+ @override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_empty'})
+ def test_showmigrations_no_migrations(self):
+ out = io.StringIO()
+ call_command('showmigrations', stdout=out, no_color=True)
+ self.assertEqual('migrations\n (no migrations)\n', out.getvalue().lower())
+
+ @override_settings(INSTALLED_APPS=['migrations.migrations_test_apps.unmigrated_app'])
+ def test_showmigrations_unmigrated_app(self):
+ with self.assertRaisesMessage(CommandError, 'No migrations present for: unmigrated_app'):
+ call_command('showmigrations', 'unmigrated_app')
+
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_empty"})
def test_showmigrations_plan_no_migrations(self):
"""