Commits

Jannis Leidel committed 64fdcc5 Merge

Auto merge.

Comments (0)

Files changed (4)

south/db/__init__.py

     # Loop over the defined databases, gathering up their engines
     db_engines = dict([
         # Note we check to see if contrib.gis has overridden us.
-        (alias, "south.db.%s" % engine_modules.get(db_settings['ENGINE'], None))
+        (alias, "south.db.%s" % engine_modules[db_settings['ENGINE']])
         for alias, db_settings in settings.DATABASES.items()
+        if db_settings['ENGINE'] in engine_modules
     ])
     # Update with any overrides
     db_engines.update(getattr(settings, "SOUTH_DATABASE_ADAPTERS", {}))

south/migration/migrators.py

             print "Error in migration: %s" % migration
             raise
         else:
-            south.db.db.commit_transaction()
+            try:
+                south.db.db.commit_transaction()
+            except:
+                print "Error during commit in migration: %s" % migration
+                raise
+                
 
     def run(self, migration):
         # Get the correct ORM.

south/tests/db_mysql.py

 
     def test_constraint_references(self):
         """Tests that referred table is reported accurately"""
+        if db.backend_name != "mysql":
+            return
         main_table = 'test_cns_ref'
         reference_table = 'test_cr_foreign'
         db.start_transaction()
 
     def test_reverse_column_constraint(self):
         """Tests that referred column in a foreign key (ex. id) is found"""
+        if db.backend_name != "mysql":
+            return
         main_table = 'test_reverse_ref'
         reference_table = 'test_rr_foreign'
         db.start_transaction()
         db.delete_table(reference_table)
 
     def test_delete_fk_column(self):
+        if db.backend_name != "mysql":
+            return
         main_table = 'test_drop_foreign'
         ref_table = 'test_df_ref'
         self._create_foreign_tables(main_table, ref_table)
         db.delete_table(ref_table)
 
     def test_rename_fk_column(self):
+        if db.backend_name != "mysql":
+            return
         main_table = 'test_rename_foreign'
         ref_table = 'test_rf_ref'
         self._create_foreign_tables(main_table, ref_table)
         Tests that the column referred to by an external column can be renamed.
         Edge case, but also useful as stepping stone to renaming tables.
         """
+        if db.backend_name != "mysql":
+            return
         main_table = 'test_rename_fk_inbound'
         ref_table = 'test_rfi_ref'
         self._create_foreign_tables(main_table, ref_table)
 
     def test_rename_constrained_table(self):
         """Renames a table with a foreign key column (towards another table)"""
+        if db.backend_name != "mysql":
+            return
         main_table = 'test_rn_table'
         ref_table = 'test_rt_ref'
         renamed_table = 'test_renamed_table'
 
     def test_renamed_referenced_table(self):
         """Rename a table referred to in a foreign key"""
+        if db.backend_name != "mysql":
+            return
         main_table = 'test_rn_refd_table'
         ref_table = 'test_rrt_ref'
         renamed_table = 'test_renamed_ref'

south/tests/logger.py

 
         # since south logging is off, and our root logger is at WARNING
         # we should not find DEBUG info in the log
-        self.assertIs(logging_stream.getvalue(), '')
+        self.assertEqual(logging_stream.getvalue(), '')
 
     def test_db_execute_logging_validfile(self):
         "Does logging work when passing in a valid file?"
             "test11",
             [('email_confirmed', models.BooleanField(default=False))],
         )
-        
-