diff --git a/.travis.yml b/.travis.yml index 331c488d..06d4a4bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,6 @@ python: - "3.3" - "3.4" env: - - DJANGO_VERSION=1.5 - - DJANGO_VERSION=1.6 - - DJANGO_VERSION=1.7 - DJANGO_VERSION=1.8 # command to run tests install: ./install_redis.sh diff --git a/README.rst b/README.rst index 4d55092d..e950f044 100644 --- a/README.rst +++ b/README.rst @@ -21,6 +21,11 @@ Docs can be found at http://django-redis-cache.readthedocs.org/en/latest/. Changelog ========= +1.7.0 +----- + +* Drops support for Django < 1.8. + 1.5.0 ----- diff --git a/redis_cache/backends/base.py b/redis_cache/backends/base.py index 46d36d43..fb8f9156 100644 --- a/redis_cache/backends/base.py +++ b/redis_cache/backends/base.py @@ -1,4 +1,6 @@ -from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError +from django.core.cache.backends.base import ( + BaseCache, DEFAULT_TIMEOUT, InvalidCacheBackendError, +) from django.core.exceptions import ImproperlyConfigured try: @@ -10,7 +12,6 @@ from redis.connection import DefaultParser -from redis_cache.compat import DEFAULT_TIMEOUT from redis_cache.connection import pool from redis_cache.utils import ( CacheKey, get_servers, parse_connection_kwargs, import_class diff --git a/redis_cache/backends/multiple.py b/redis_cache/backends/multiple.py index 6db0d934..820dea98 100644 --- a/redis_cache/backends/multiple.py +++ b/redis_cache/backends/multiple.py @@ -1,7 +1,8 @@ from collections import defaultdict +from django.core.cache.backends.base import DEFAULT_TIMEOUT + from redis_cache.backends.base import BaseRedisCache -from redis_cache.compat import DEFAULT_TIMEOUT from redis_cache.sharder import HashRing diff --git a/redis_cache/backends/single.py b/redis_cache/backends/single.py index 210c6589..f13aec74 100644 --- a/redis_cache/backends/single.py +++ b/redis_cache/backends/single.py @@ -1,11 +1,11 @@ -from redis_cache.compat import DEFAULT_TIMEOUT - try: import cPickle as pickle except ImportError: import pickle import random +from django.core.cache.backends.base import DEFAULT_TIMEOUT + from redis_cache.backends.base import BaseRedisCache diff --git a/redis_cache/compat.py b/redis_cache/compat.py index b6a7d5e4..4d9dcb00 100644 --- a/redis_cache/compat.py +++ b/redis_cache/compat.py @@ -1,5 +1,4 @@ import sys -import django PY3 = (sys.version_info >= (3,)) @@ -19,10 +18,3 @@ else: bytes_type = str from urlparse import parse_qs, urlparse - - -if django.VERSION[:2] >= (1, 6): - from django.core.cache.backends.base import DEFAULT_TIMEOUT as DJANGO_DEFAULT_TIMEOUT - DEFAULT_TIMEOUT = DJANGO_DEFAULT_TIMEOUT -else: - DEFAULT_TIMEOUT = None diff --git a/setup.py b/setup.py index f623efc5..b18a930f 100644 --- a/setup.py +++ b/setup.py @@ -20,9 +20,6 @@ "Topic :: Utilities", "Environment :: Web Environment", "Framework :: Django", - "Framework :: Django :: 1.5", - "Framework :: Django :: 1.6", - "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", ], ) diff --git a/tests/testapp/tests/base_tests.py b/tests/testapp/tests/base_tests.py index 1cb198d9..d86da1af 100644 --- a/tests/testapp/tests/base_tests.py +++ b/tests/testapp/tests/base_tests.py @@ -5,7 +5,6 @@ import os import subprocess import time -import unittest try: @@ -15,17 +14,13 @@ from django.core.cache import get_cache from django.core.exceptions import ImproperlyConfigured -from django.test import TestCase -try: - from django.test import override_settings -except ImportError: - from django.test.utils import override_settings +from django.test import TestCase, override_settings import redis from tests.testapp.models import Poll, expensive_calculation from redis_cache.cache import RedisCache, pool -from redis_cache.compat import DEFAULT_TIMEOUT, smart_bytes +from redis_cache.compat import smart_bytes from redis_cache.utils import get_servers, parse_connection_kwargs @@ -294,7 +289,6 @@ def test_expiration(self): self.assertEqual(self.cache.get("expire2"), "newvalue") self.assertEqual("expire3" in self.cache, False) - @unittest.skipIf(DEFAULT_TIMEOUT is None, "Version of django doesn't support indefinite timeouts.") def test_set_expiration_timeout_None(self): key, value = 'key', 'value' self.cache.set(key, value, timeout=None) @@ -558,7 +552,6 @@ def test_ttl_set_expiry(self): ttl = self.cache.ttl('a') self.assertAlmostEqual(ttl, 10) - @unittest.skipIf(DEFAULT_TIMEOUT is None, "Version of django doesn't support indefinite timeouts.") def test_ttl_no_expiry(self): self.cache.set('a', 'a', timeout=None) ttl = self.cache.ttl('a') diff --git a/tests/testapp/tests/compressor_tests.py b/tests/testapp/tests/compressor_tests.py index 660cf9d1..392e0c92 100644 --- a/tests/testapp/tests/compressor_tests.py +++ b/tests/testapp/tests/compressor_tests.py @@ -1,10 +1,5 @@ # -*- coding: utf-8 -*- -try: - from django.test import override_settings -except ImportError: - from django.test.utils import override_settings -from django.test import TestCase - +from django.test import TestCase, override_settings from tests.testapp.tests.base_tests import BaseRedisTestCase diff --git a/tests/testapp/tests/master_slave_tests.py b/tests/testapp/tests/master_slave_tests.py index 951f34fe..b1dad180 100644 --- a/tests/testapp/tests/master_slave_tests.py +++ b/tests/testapp/tests/master_slave_tests.py @@ -1,10 +1,6 @@ import time -from django.test import TestCase -try: - from django.test import override_settings -except ImportError: - from django.test.utils import override_settings +from django.test import TestCase, override_settings from redis_cache.connection import pool diff --git a/tests/testapp/tests/serializers_tests.py b/tests/testapp/tests/serializers_tests.py index 403b5332..338ffe85 100644 --- a/tests/testapp/tests/serializers_tests.py +++ b/tests/testapp/tests/serializers_tests.py @@ -1,11 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from django.test import TestCase -try: - from django.test import override_settings -except ImportError: - from django.test.utils import override_settings +from django.test import TestCase, override_settings from tests.testapp.tests.base_tests import SetupMixin @@ -171,4 +167,3 @@ class MSGPackSerializerTestCase(BaseSerializerTestCase): class YAMLSerializerTestCase(BaseSerializerTestCase): converts_tuple_to_list = False serializes_objects = True - diff --git a/tests/testapp/tests/socket_tests.py b/tests/testapp/tests/socket_tests.py index b02707e4..4efbf1a1 100644 --- a/tests/testapp/tests/socket_tests.py +++ b/tests/testapp/tests/socket_tests.py @@ -3,11 +3,7 @@ from tests.testapp.tests.base_tests import BaseRedisTestCase from tests.testapp.tests.multi_server_tests import MultiServerTests -try: - from django.test import override_settings -except ImportError: - from django.test.utils import override_settings -from django.test import TestCase +from django.test import TestCase, override_settings LOCATION = "unix://:yadayada@/tmp/redis0.sock?db=15" diff --git a/tests/testapp/tests/socket_timeout_tests.py b/tests/testapp/tests/socket_timeout_tests.py index 0dc381ab..90e7d52a 100644 --- a/tests/testapp/tests/socket_timeout_tests.py +++ b/tests/testapp/tests/socket_timeout_tests.py @@ -1,9 +1,5 @@ # -*- coding: utf-8 -*- -try: - from django.test import override_settings -except ImportError: - from django.test.utils import override_settings -from django.test import TestCase +from django.test import TestCase, override_settings from redis.exceptions import ConnectionError from tests.testapp.tests.base_tests import SetupMixin diff --git a/tests/testapp/tests/tcp_tests.py b/tests/testapp/tests/tcp_tests.py index 86a50382..1ebd6e1d 100644 --- a/tests/testapp/tests/tcp_tests.py +++ b/tests/testapp/tests/tcp_tests.py @@ -1,11 +1,7 @@ # -*- coding: utf-8 -*- from tests.testapp.tests.base_tests import BaseRedisTestCase from tests.testapp.tests.multi_server_tests import MultiServerTests -try: - from django.test import override_settings -except ImportError: - from django.test.utils import override_settings -from django.test import TestCase +from django.test import TestCase, override_settings from redis_cache.cache import ImproperlyConfigured from redis.connection import UnixDomainSocketConnection