summaryrefslogtreecommitdiff
path: root/tests/sessions_tests
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2016-02-25 20:04:03 -0500
committerSimon Charette <charette.s@gmail.com>2016-02-26 11:22:33 -0500
commit62ea86448ee1e56c96a4275da5d42f39680a611c (patch)
tree5863ec63dce818dbad9bef33895363f2263d9a1f /tests/sessions_tests
parent8890c533e0b53cb0021bd5faf15668430cd3075a (diff)
downloaddjango-62ea86448ee1e56c96a4275da5d42f39680a611c.tar.gz
Cleaned up session backends tests.
Made SessionTestsMixin backend agnostic and removed code obsoleted by the test discovery refactor.
Diffstat (limited to 'tests/sessions_tests')
-rw-r--r--tests/sessions_tests/tests.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/sessions_tests/tests.py b/tests/sessions_tests/tests.py
index d284dc8236..7b3feec565 100644
--- a/tests/sessions_tests/tests.py
+++ b/tests/sessions_tests/tests.py
@@ -149,9 +149,6 @@ class SessionTestsMixin(object):
self.assertTrue(self.session.modified)
def test_save(self):
- if (hasattr(self.session, '_cache') and 'DummyCache' in
- settings.CACHES[settings.SESSION_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))
@@ -345,8 +342,6 @@ class SessionTestsMixin(object):
Creating session records on load is a DOS vulnerability.
"""
- if self.backend is CookieSession:
- raise unittest.SkipTest("Cookie backend doesn't have an external store to create records in.")
session = self.backend('someunknownkey')
session.load()
@@ -458,9 +453,6 @@ class CacheDBSessionTests(SessionTestsMixin, TestCase):
backend = CacheDBSession
- @unittest.skipIf('DummyCache' in
- settings.CACHES[settings.SESSION_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):
@@ -812,3 +804,7 @@ class CookieSessionTests(SessionTestsMixin, unittest.TestCase):
self.session.serializer = PickleSerializer
self.session.load()
+
+ @unittest.skip("Cookie backend doesn't have an external store to create records in.")
+ def test_session_load_does_not_create_record(self):
+ pass