diff --git a/release_util/tests/test_migration_commands.py b/release_util/tests/test_migration_commands.py index 26d219f..234076c 100644 --- a/release_util/tests/test_migration_commands.py +++ b/release_util/tests/test_migration_commands.py @@ -230,6 +230,25 @@ def test_showmigrations_list(self): call_command("migrate", "release_util", "0003", verbosity=0) + for fail_on_unapplied, exit_code in ( + (True, 1), + (False, 0), + ): + self._check_command_output( + cmd="show_unapplied_migrations", + cmd_kwargs={'fail_on_unapplied': fail_on_unapplied}, + output={ + 'database': 'default', + 'initial_states': [{'app': 'release_util', 'migration': '0003_third'}], + 'migrations': [ + {'app': 'release_util', 'migration': '0004_fourth'}, + ] + }, + exit_value=exit_code + ) + + call_command("migrate", "release_util", "0004", verbosity=0) + for fail_on_unapplied, exit_code in ( (True, 0), (False, 0),