Commits

Jason Moiron committed 83a3c8e

fix tests for Django 1.4a where settings will no longer report a DATABASE_ENGINE setting; if it's there, still check against it to prevent invalid test errors, but otherwise check all databases and fail if any don't support multithreading

  • Participants
  • Parent commits ef0acb8

Comments (0)

Files changed (1)

johnny/tests/cache.py

         if len(getattr(settings, "DATABASES", [])) <= 1:
             print "\n  Skipping multi database tests"
             return
-        if settings.DATABASE_ENGINE == 'sqlite3':
-            print "\n  Skipping test requiring multiple threads."
-            return
+        if hasattr(settings, 'DATABASE_ENGINE'):
+            if settings.DATABASE_ENGINE == 'sqlite3':
+                print "\n  Skipping test requiring multiple threads."
+                return
+        else:
+            for db in settings.DATABASES.values():
+                if db['ENGINE'] == 'sqlite3':
+                    print "\n  Skipping test requiring multiple threads."
+                    return
         from Queue import Queue as queue
         q = queue()
         other = lambda x: self._run_threaded(x, q)