Commits

Jason Moiron committed c38c8ab

remove a pdb statement from the test suite, take care of django-trunk deprecation warnings for template loaders in settings & settings insertion in tests/base

  • Participants
  • Parent commits 3bd6e14
  • Tags johnny-cache-0.2.1

Comments (0)

Files changed (3)

File johnny/tests/base.py

 
 import sys
 
+import django
 from django.test import TestCase, TransactionTestCase
 from django.conf import settings
 from django.core.management import call_command
         self.saved_DISABLE_SETTING = getattr(johnny_settings, 'DISABLE_QUERYSET_CACHE', False)
         johnny_settings.DISABLE_QUERYSET_CACHE = False
         self.saved_TEMPLATE_LOADERS = settings.TEMPLATE_LOADERS
-        if 'django.template.loaders.app_directories.load_template_source' not in settings.TEMPLATE_LOADERS:
-            settings.TEMPLATE_LOADERS += ('django.template.loaders.app_directories.load_template_source',)
+        if django.VERSION[:2] < (1, 3):
+            if 'django.template.loaders.app_directories.load_template_source' not in settings.TEMPLATE_LOADERS:
+                settings.TEMPLATE_LOADERS += ('django.template.loaders.app_directories.load_template_source',)
+        else:
+            if 'django.template.loaders.app_directories.Loader' not in settings.TEMPLATE_LOADERS:
+                settings.TEMPLATE_LOADERS += ('django.template.loaders.app_directories.Loader',)
         self.middleware = middleware.QueryCacheMiddleware()
         self.saved_ROOT_URLCONF = settings.ROOT_URLCONF
         settings.ROOT_URLCONF = 'johnny.tests.testapp.urls'

File johnny/tests/web.py

         populate the cache properly."""
         connection.queries = []
         q = base.message_queue()
-        import ipdb; ipdb.set_trace();
         response = self.client.get('/test/template_queries')
         self.failUnless(q.get() is False)
         response = self.client.get('/test/template_queries')
 SECRET_KEY = '_vpn1a^j(6&+3qip2me4f#&8#m#*#icc!%=x=)rha4k=!4m8s4'
 
 # List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.load_template_source',
-#    'django.template.loaders.app_directories.load_template_source',
-#    'django.template.loaders.eggs.load_template_source',
-)
+if django.VERSION[:2] < (1, 3):
+    TEMPLATE_LOADERS = (
+        'django.template.loaders.filesystem.load_template_source',
+    #    'django.template.loaders.app_directories.load_template_source',
+    #    'django.template.loaders.eggs.load_template_source',
+    )
+else:
+    TEMPLATE_LOADERS = (
+        'django.template.loaders.filesystem.Loader',
+    #    'django.template.loaders.app_directories.Loader',
+    #    'django.template.loaders.eggs.Loader',
+    )
 
 MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',