[1.7.x] Fixed test failures introduced by refs #22881.

Backport of 908160f692 from master
This commit is contained in:
Tim Graham 2014-06-23 08:45:06 -04:00
parent d38e3bfe5a
commit 21c9591384
1 changed files with 7 additions and 0 deletions

View File

@ -97,11 +97,18 @@ class MigrateTests(MigrationTestBase):
stdout = six.StringIO() stdout = six.StringIO()
call_command("sqlmigrate", "migrations", "0001", stdout=stdout) call_command("sqlmigrate", "migrations", "0001", stdout=stdout)
self.assertIn("create table", stdout.getvalue().lower()) self.assertIn("create table", stdout.getvalue().lower())
# Cannot generate the reverse SQL unless we've applied the migration.
call_command("migrate", "migrations", verbosity=0)
# And backwards is a DROP TABLE # And backwards is a DROP TABLE
stdout = six.StringIO() stdout = six.StringIO()
call_command("sqlmigrate", "migrations", "0001", stdout=stdout, backwards=True) call_command("sqlmigrate", "migrations", "0001", stdout=stdout, backwards=True)
self.assertIn("drop table", stdout.getvalue().lower()) self.assertIn("drop table", stdout.getvalue().lower())
# Cleanup by unmigrating everything
call_command("migrate", "migrations", "zero", verbosity=0)
@override_system_checks([]) @override_system_checks([])
@override_settings( @override_settings(
INSTALLED_APPS=[ INSTALLED_APPS=[