Jason Moiron avatar 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

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)
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.