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
9285808a
Commit
9285808a
authored
May 06, 2014
by
Sean Bleier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds test to show a timeout of None can be provided and have the key not expire.
parent
7e1c3083
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
tests.py
tests/testapp/tests.py
+7
-4
No files found.
tests/testapp/tests.py
View file @
9285808a
...
...
@@ -216,10 +216,13 @@ class RedisCacheTests(TestCase):
self
.
assertEqual
(
self
.
cache
.
get
(
"expire2"
),
"newvalue"
)
self
.
assertEqual
(
self
.
cache
.
has_key
(
"expire3"
),
False
)
def
test_set_expiration_timeout_None
(
self
):
key
,
value
=
self
.
cache
.
make_key
(
'key'
),
'value'
self
.
cache
.
set
(
key
,
value
)
self
.
assertTrue
(
self
.
cache
.
_client
.
ttl
(
key
)
>
0
)
def
test_set_expiration_default_timeout
(
self
):
self
.
cache
.
set
(
'a'
,
'a'
)
self
.
assertTrue
(
self
.
cache
.
_client
.
ttl
(
self
.
cache
.
make_key
(
'a'
))
>
0
)
def
test_set_expiration_no_timeout
(
self
):
self
.
cache
.
set
(
'a'
,
'a'
,
timeout
=
None
)
self
.
assertTrue
(
self
.
cache
.
_client
.
ttl
(
self
.
cache
.
make_key
(
'a'
))
is
None
)
def
test_set_expiration_timeout_zero
(
self
):
key
,
value
=
self
.
cache
.
make_key
(
'key'
),
'value'
...
...
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