diff --git a/CHANGES b/CHANGES index f5a2259..e9c1e44 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +0.5.3 +===== +- Remove mockredis as install requirement, make only test requirement [@blueyed] + 0.5.2 ===== - Fix regex in 'unblock_username_view' to handle special symbols [@ruthus18] diff --git a/README.md b/README.md index 4e0a694..81124fd 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,9 @@ If you are using defender on your site, submit a PR to add to the list. Versions ======== +- 0.5.3 [in progress] + - Remove mockredis as install requirement, make only test requirement [@blueyed] + - 0.5.2 - Fix regex in 'unblock_username_view' to handle special symbols [@ruthus18] - Fix django requires version for 1.11.x [@kencochrane] diff --git a/defender/connection.py b/defender/connection.py index a4db7b4..340f015 100644 --- a/defender/connection.py +++ b/defender/connection.py @@ -1,6 +1,6 @@ from django.core.cache import caches from django.core.cache.backends.base import InvalidCacheBackendError -import mockredis + import redis try: import urlparse @@ -12,8 +12,6 @@ # Register database schemes in URLs. urlparse.uses_netloc.append("redis") - -MOCKED_REDIS = mockredis.mock_strict_redis_client() INVALID_CACHE_ERROR_MSG = 'The cache {} was not found on the django cache' \ ' settings.' @@ -21,7 +19,8 @@ def get_redis_connection(): """ Get the redis connection if not using mock """ if config.MOCK_REDIS: # pragma: no cover - return MOCKED_REDIS # pragma: no cover + import mockredis + return mockredis.mock_strict_redis_client() # pragma: no cover elif config.DEFENDER_REDIS_NAME: # pragma: no cover try: cache = caches[config.DEFENDER_REDIS_NAME] diff --git a/setup.py b/setup.py index bfb5652..90c38a0 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from distutils.core import setup -version = '0.5.2' +version = '0.5.3' def get_packages(package): @@ -68,7 +68,7 @@ def get_package_data(package): include_package_data=True, packages=get_packages('defender'), package_data=get_package_data('defender'), - install_requires=['Django>=1.8,<2.1', 'redis>=2.10.3,<3.0', - 'mockredispy>=2.9.0.11,<3.0'], - tests_require=['mock', 'mockredispy', 'coverage', 'celery', 'django-redis-cache'], + install_requires=['Django>=1.8,<2.1', 'redis>=2.10.3,<3.0'], + tests_require=['mock', 'mockredispy>=2.9.0.11,<3.0', 'coverage', + 'celery', 'django-redis-cache'], )