Tay Ray Chuan avatar Tay Ray Chuan committed ce92133

tests.db.test_unique: use skipIf

Strip trailing space on import line while we're at it.

Comments (0)

Files changed (1)

south/tests/db.py

 from south.db import db, generic
 from django.db import connection, models, IntegrityError
 
-from south.tests import unittest, skipUnless        
+from south.tests import unittest, skipIf, skipUnless
 
 # Create a list of error classes from the various database libraries
 errors = []
         # We need to match up for tearDown
         db.start_transaction()
     
+    @skipIf(db.backend_name == "sqlite3", "SQLite backend doesn't support this "
+                                          "yet.")
     def test_unique(self):
         """
         Tests creating/deleting unique constraints.
         """
-        
-        # SQLite backend doesn't support this yet.
-        if db.backend_name == "sqlite3":
-            return
-        
         db.create_table("test_unique2", [
             ('id', models.AutoField(primary_key=True)),
         ])
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.