diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-09-21 13:12:51 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-09-21 13:17:25 +0200 |
| commit | 486e67598f8d8e83890ef3c90399d660d8e9eee6 (patch) | |
| tree | 9d34c5d8c6131964b5b71a3a93e15f58682ae72a | |
| parent | e758ecc628bb1d8960d0a59a140a43d7103e89e4 (diff) | |
Fixed #10853 -- Skipped some sessions tests with dummy cache backend
| -rw-r--r-- | django/contrib/sessions/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/django/contrib/sessions/tests.py b/django/contrib/sessions/tests.py index 9aa602f416..fc2d8753d7 100644 --- a/django/contrib/sessions/tests.py +++ b/django/contrib/sessions/tests.py @@ -12,6 +12,7 @@ from django.contrib.sessions.backends.file import SessionStore as FileSession from django.contrib.sessions.backends.signed_cookies import SessionStore as CookieSession from django.contrib.sessions.models import Session from django.contrib.sessions.middleware import SessionMiddleware +from django.core.cache import DEFAULT_CACHE_ALIAS from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation from django.http import HttpResponse from django.test import TestCase, RequestFactory @@ -133,6 +134,9 @@ class SessionTestsMixin(object): self.assertTrue(self.session.modified) def test_save(self): + if (hasattr(self.session, '_cache') and + 'DummyCache' in settings.CACHES[DEFAULT_CACHE_ALIAS]['BACKEND']): + raise unittest.SkipTest("Session saving tests require a real cache backend") self.session.save() self.assertTrue(self.session.exists(self.session.session_key)) @@ -296,6 +300,8 @@ class CacheDBSessionTests(SessionTestsMixin, TestCase): backend = CacheDBSession + @unittest.skipIf('DummyCache' in settings.CACHES[DEFAULT_CACHE_ALIAS]['BACKEND'], + "Session saving tests require a real cache backend") def test_exists_searches_cache_first(self): self.session.save() with self.assertNumQueries(0): |
