Andrew Godwin avatar Andrew Godwin committed 4586507

Fix unit tests from bfirsh's changes

Comments (0)

Files changed (1)

south/tests/logic.py

         self.assertEqual(list(migration.MigrationHistory.objects.all()), [])
         
         # Apply them normally
-        migration.migrate_app(app, target_name=None, resolve_mode=None, fake=False, verbosity=0)
+        tree = migration.dependency_tree()
+        migration.migrate_app(app, tree, target_name=None, resolve_mode=None, fake=False, verbosity=0)
         
         # We should finish with all migrations
         self.assertListEqual(
         )
         
         # Now roll them backwards
-        migration.migrate_app(app, target_name="zero", resolve_mode=None, fake=False, verbosity=0)
+        migration.migrate_app(app, tree, target_name="zero", resolve_mode=None, fake=False, verbosity=0)
         
         # Finish with none
         self.assertEqual(list(migration.MigrationHistory.objects.all()), [])
         )
         
         # Apply them normally
+        tree = migration.dependency_tree()
         try:
             # Redirect the error it will print to nowhere
             stdout, sys.stdout = sys.stdout, StringIO.StringIO()
-            migration.migrate_app(app, target_name=None, resolve_mode=None, fake=False, verbosity=0)
+            migration.migrate_app(app, tree, target_name=None, resolve_mode=None, fake=False, verbosity=0)
             sys.stdout = stdout
         except SystemExit:
             pass
         )
         
         # Apply with merge
-        migration.migrate_app(app, target_name=None, resolve_mode="merge", fake=False, verbosity=0)
+        migration.migrate_app(app, tree, target_name=None, resolve_mode="merge", fake=False, verbosity=0)
         
         # We should finish with all migrations
         self.assertListEqual(
         )
         
         # Now roll them backwards
-        migration.migrate_app(app, target_name="0002", resolve_mode=None, fake=False, verbosity=0)
-        migration.migrate_app(app, target_name="0001", resolve_mode=None, fake=True, verbosity=0)
-        migration.migrate_app(app, target_name="zero", resolve_mode=None, fake=False, verbosity=0)
+        migration.migrate_app(app, tree, target_name="0002", resolve_mode=None, fake=False, verbosity=0)
+        migration.migrate_app(app, tree, target_name="0001", resolve_mode=None, fake=True, verbosity=0)
+        migration.migrate_app(app, tree, target_name="zero", resolve_mode=None, fake=False, verbosity=0)
         
         # Finish with none
         self.assertEqual(list(migration.MigrationHistory.objects.all()), [])
                 return True
         
         app = migration.get_app("fakeapp")
+        tree = migration.dependency_tree()
         self.assertEqual(list(migration.MigrationHistory.objects.all()), [])
         
         # by default name is NOT NULL
-        migration.migrate_app(app, target_name="0002", resolve_mode=None, fake=False, verbosity=0)
+        migration.migrate_app(app, tree, target_name="0002", resolve_mode=None, fake=False, verbosity=0)
         self.failIf(null_ok())
         
         # after 0003, it should be NULL
-        migration.migrate_app(app, target_name="0003", resolve_mode=None, fake=False, verbosity=0)
+        migration.migrate_app(app, tree, target_name="0003", resolve_mode=None, fake=False, verbosity=0)
         self.assert_(null_ok())
 
         # make sure it is NOT NULL again
-        migration.migrate_app(app, target_name="0002", resolve_mode=None, fake=False, verbosity=0)
+        migration.migrate_app(app, tree, target_name="0002", resolve_mode=None, fake=False, verbosity=0)
         self.failIf(null_ok(), 'name not null after migration')
         
         # finish with no migrations, otherwise other tests fail...
-        migration.migrate_app(app, target_name="zero", resolve_mode=None, fake=False, verbosity=0)
+        migration.migrate_app(app, tree, target_name="zero", resolve_mode=None, fake=False, verbosity=0)
         self.assertEqual(list(migration.MigrationHistory.objects.all()), [])
     
     def test_dependencies(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.