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
2efe6f91
Commit
2efe6f91
authored
Feb 20, 2013
by
Sean Bleier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #49 from kerash/master
Broken boolean values
parents
c1b64b7c
250f1fc0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
cache.py
redis_cache/cache.py
+1
-1
tests.py
tests/testapp/tests.py
+6
-0
No files found.
redis_cache/cache.py
View file @
2efe6f91
...
@@ -211,7 +211,7 @@ class CacheClass(BaseCache):
...
@@ -211,7 +211,7 @@ class CacheClass(BaseCache):
timeout
=
self
.
default_timeout
timeout
=
self
.
default_timeout
# If ``value`` is not an int, then pickle it
# If ``value`` is not an int, then pickle it
if
not
isinstance
(
value
,
int
):
if
not
isinstance
(
value
,
int
)
or
isinstance
(
value
,
bool
)
:
result
=
self
.
_set
(
key
,
pickle
.
dumps
(
value
),
int
(
timeout
),
client
,
_add_only
)
result
=
self
.
_set
(
key
,
pickle
.
dumps
(
value
),
int
(
timeout
),
client
,
_add_only
)
else
:
else
:
result
=
self
.
_set
(
key
,
value
,
int
(
timeout
),
client
,
_add_only
)
result
=
self
.
_set
(
key
,
value
,
int
(
timeout
),
client
,
_add_only
)
...
...
tests/testapp/tests.py
View file @
2efe6f91
...
@@ -360,6 +360,12 @@ class RedisCacheTests(TestCase):
...
@@ -360,6 +360,12 @@ class RedisCacheTests(TestCase):
self
.
assertTrue
(
self
.
cache
.
set
(
"foo"
,
"1"
))
self
.
assertTrue
(
self
.
cache
.
set
(
"foo"
,
"1"
))
self
.
assertEqual
(
self
.
cache
.
get
(
"foo"
),
"1"
)
self
.
assertEqual
(
self
.
cache
.
get
(
"foo"
),
"1"
)
def
test_setting_bool_retrieves_bool
(
self
):
self
.
assertTrue
(
self
.
cache
.
set
(
"bool_t"
,
True
))
self
.
assertEqual
(
self
.
cache
.
get
(
"bool_t"
),
True
)
self
.
assertTrue
(
self
.
cache
.
set
(
"bool_f"
,
False
))
self
.
assertEqual
(
self
.
cache
.
get
(
"bool_f"
),
False
)
...
...
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