Commits

Anonymous committed 98848ce

Fix the current very simple tests to work again.

  • Participants
  • Parent commits 4eba2b0

Comments (0)

Files changed (1)

 import unittest
 
 from south.db import db
-from django.db import connection
+from django.db import connection, models
 
 # Create a list of error classes from the various database libraries
 errors = []
         self.assertRaises(TypeError, db.create_table)
         self.assertRaises(TypeError, db.create_table, "test1")
         # Empty tables (i.e. no columns) are not fine, so make at least 1
-        db.create_table("test1", [("col", "text")])
-        db.commit_transaction()
+        db.create_table("test1", [('email_confirmed', models.BooleanField(default=False))])
+        db.start_transaction()
         # And should exist
         cursor.execute("SELECT * FROM test1")
         # Make sure we can't do the same query on an empty table
             pass
         # Clear the dirty transaction
         db.rollback_transaction()
+        db.start_transaction()
         # Remove the table
         db.delete_table("test1")
         # Make sure it went
             pass
         # Clear the dirty transaction
         db.rollback_transaction()
+        db.start_transaction()
         # Try deleting a nonexistent one
         try:
             db.delete_table("nottheretest1")
             self.fail("Non-existent table could be deleted!")
         except:
             pass
+        db.rollback_transaction()
     
     def test_rename(self):
         """
         Test column renaming
         """
         cursor = connection.cursor()
-        db.create_table("test2", [("spam", "text")])
-        db.commit_transaction()
+        db.create_table("test2", [('spam', models.BooleanField(default=False))])
+        db.start_transaction()
         # Make sure we can select the column
         cursor.execute("SELECT spam FROM test2")
         # Rename it
             cursor.execute("SELECT spam FROM test2")
             self.fail("Just-renamed column could be selected!")
         except:
-            pass
+            pass
+        db.rollback_transaction()