Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
Django-Redis-Cache
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared
Django-Redis-Cache
Commits
5aab1f02
Commit
5aab1f02
authored
Jun 08, 2011
by
Timothée Peignier
Committed by
Sean Bleier
Jun 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add compatibility with redis-py new connection pool
parent
1ef99abe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
cache.py
redis_cache/cache.py
+1
-1
setup.py
setup.py
+1
-1
tests.py
tests/testapp/tests.py
+5
-5
No files found.
redis_cache/cache.py
View file @
5aab1f02
...
...
@@ -182,7 +182,7 @@ class CacheClass(BaseCache):
"""
Disconnect from the cache.
"""
self
.
_cache
.
connection
.
disconnect
()
self
.
_cache
.
connection
_pool
.
disconnect
()
class
RedisCache
(
CacheClass
):
"""
...
...
setup.py
View file @
5aab1f02
...
...
@@ -8,7 +8,7 @@ setup(
version
=
"0.5.1"
,
packages
=
[
"redis_cache"
],
description
=
"Redis Cache Backend for Django"
,
install_requires
=
[
'redis'
,],
install_requires
=
[
'redis
>=2.4.0
'
,],
classifiers
=
[
"Programming Language :: Python"
,
"Operating System :: OS Independent"
,
...
...
tests/testapp/tests.py
View file @
5aab1f02
...
...
@@ -41,17 +41,17 @@ class RedisCacheTests(unittest.TestCase):
def
test_bad_db_initialization
(
self
):
self
.
cache
=
self
.
get_cache
(
'redis_cache.cache://127.0.0.1:6379?db=not_a_number'
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
db
,
1
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
connection_pool
.
connection_kwargs
[
'db'
]
,
1
)
def
test_bad_port_initialization
(
self
):
self
.
cache
=
self
.
get_cache
(
'redis_cache.cache://127.0.0.1:not_a_number?db=15'
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
port
,
6379
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
connection_pool
.
connection_kwargs
[
'port'
]
,
6379
)
def
test_default_initialization
(
self
):
self
.
cache
=
self
.
get_cache
(
'redis_cache.cache://127.0.0.1'
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
host
,
'127.0.0.1'
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
db
,
1
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
port
,
6379
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
connection_pool
.
connection_kwargs
[
'host'
]
,
'127.0.0.1'
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
connection_pool
.
connection_kwargs
[
'db'
]
,
1
)
self
.
assertEqual
(
self
.
cache
.
_cache
.
connection_pool
.
connection_kwargs
[
'port'
]
,
6379
)
def
test_simple
(
self
):
# Simple cache set/get works
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment