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
533a836f
Commit
533a836f
authored
Dec 10, 2015
by
Sean Bleier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to show declaring pickle version doesn't transfer to serializer.
parent
199c3230
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
serializers_tests.py
tests/testapp/tests/serializers_tests.py
+22
-3
No files found.
tests/testapp/tests/serializers_tests.py
View file @
533a836f
...
@@ -7,8 +7,6 @@ try:
...
@@ -7,8 +7,6 @@ try:
except
ImportError
:
except
ImportError
:
from
django.test.utils
import
override_settings
from
django.test.utils
import
override_settings
from
redis_cache.connection
import
pool
from
tests.testapp.tests.base_tests
import
SetupMixin
from
tests.testapp.tests.base_tests
import
SetupMixin
...
@@ -84,7 +82,28 @@ class BaseSerializerTestCase(SetupMixin, TestCase):
...
@@ -84,7 +82,28 @@ class BaseSerializerTestCase(SetupMixin, TestCase):
'DB'
:
1
,
'DB'
:
1
,
'PASSWORD'
:
'yadayada'
,
'PASSWORD'
:
'yadayada'
,
'PARSER_CLASS'
:
'redis.connection.HiredisParser'
,
'PARSER_CLASS'
:
'redis.connection.HiredisParser'
,
'PICKLE_VERSION'
:
-
1
,
'PICKLE_VERSION'
:
1
,
'SERIALIZER_CLASS'
:
'redis_cache.serializers.PickleSerializer'
},
},
})
class
PickleSerializerTestCase
(
BaseSerializerTestCase
):
converts_tuple_to_list
=
False
serializes_objects
=
True
def
test_pickle_version
(
self
):
self
.
assertEqual
(
self
.
cache
.
serializer
.
pickle_version
,
1
)
@
override_settings
(
CACHES
=
{
'default'
:
{
'BACKEND'
:
'redis_cache.RedisCache'
,
'LOCATION'
:
LOCATION
,
'OPTIONS'
:
{
'DB'
:
1
,
'PASSWORD'
:
'yadayada'
,
'PARSER_CLASS'
:
'redis.connection.HiredisParser'
,
'PICKLE_VERSION'
:
1
,
'SERIALIZER_CLASS'
:
'redis_cache.serializers.JSONSerializer'
'SERIALIZER_CLASS'
:
'redis_cache.serializers.JSONSerializer'
},
},
},
},
...
...
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