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
6e413f92
Commit
6e413f92
authored
Aug 26, 2016
by
Tim Graham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Confirm support for Django 1.9/1.10
parent
1b2be04a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
15 deletions
+28
-15
.travis.yml
.travis.yml
+13
-5
Makefile
Makefile
+2
-2
README.rst
README.rst
+1
-0
requirements-dev.txt
requirements-dev.txt
+1
-1
setup.py
setup.py
+2
-0
base_tests.py
tests/testapp/tests/base_tests.py
+6
-4
views.py
tests/views.py
+3
-3
No files found.
.travis.yml
View file @
6e413f92
language
:
python
python
:
-
"
2.7"
-
"
3.3"
-
"
3.4"
-
"
3.5"
-
2.7
-
3.3
-
3.4
-
3.5
env
:
-
DJANGO_VERSION=1.8
-
DJANGO_VERSION='>=1.8a1,<1.9'
-
DJANGO_VERSION='>=1.9a1,<1.10'
-
DJANGO_VERSION='>=1.10a1,<1.11'
matrix
:
exclude
:
-
python
:
3.3
env
:
DJANGO_VERSION='>=1.9a1,<1.10'
-
python
:
3.3
env
:
DJANGO_VERSION='>=1.10a1,<1.11'
# command to run tests
install
:
./install_redis.sh
script
:
make test DJANGO_VERSION=$DJANGO_VERSION
...
...
Makefile
View file @
6e413f92
SHELL
:=
/bin/bash
PACKAGE_NAME
=
redis_cache
DJANGO_VERSION
?=
1.7
DJANGO_VERSION
?=
>=
1.10a1,<1.11
.PHONY
:
install_requirements
install_requirements
:
requirements*.txt
pip
install
-r
requirements.txt
pip
install
-r
requirements-dev.txt
pip
install
Django
==
$(DJANGO_VERSION)
pip
install
'Django
$(DJANGO_VERSION)
'
.PHONY
:
clean
clean
:
...
...
README.rst
View file @
6e413f92
...
...
@@ -25,6 +25,7 @@ Changelog
-----
* Drops support for Django < 1.8 and Python 3.2.
* Confirms support for Django 1.9 and 1.10.
1.5.0
-----
...
...
requirements-dev.txt
View file @
6e413f92
hiredis==0.2.0
django-nose==1.4
django-nose==1.4
.4
nose==1.3.6
msgpack-python==0.4.6
pyyaml==3.11
setup.py
View file @
6e413f92
...
...
@@ -21,5 +21,7 @@ setup(
"Environment :: Web Environment"
,
"Framework :: Django"
,
"Framework :: Django :: 1.8"
,
"Framework :: Django :: 1.9"
,
"Framework :: Django :: 1.10"
,
],
)
tests/testapp/tests/base_tests.py
View file @
6e413f92
...
...
@@ -12,7 +12,7 @@ try:
except
ImportError
:
import
pickle
from
django.core.cache
import
get_cache
from
django.core.cache
import
caches
from
django.core.exceptions
import
ImproperlyConfigured
from
django.test
import
TestCase
,
override_settings
from
django.utils.encoding
import
force_bytes
...
...
@@ -122,6 +122,8 @@ class SetupMixin(object):
self
.
cache
=
self
.
get_cache
()
def
tearDown
(
self
):
# clear caches to allow @override_settings(CACHES=...) to work.
caches
.
_caches
.
caches
=
{}
# Sometimes it will be necessary to skip this method because we need to
# test default initialization and that may be using a different port
# than the test redis server.
...
...
@@ -134,7 +136,7 @@ class SetupMixin(object):
pool
.
reset
()
def
get_cache
(
self
,
backend
=
None
):
return
get_cache
(
backend
or
'default'
)
return
caches
[
backend
or
'default'
]
class
BaseRedisTestCase
(
SetupMixin
):
...
...
@@ -514,7 +516,7 @@ class BaseRedisTestCase(SetupMixin):
def
test_max_connections
(
self
):
pool
.
_connection_pools
=
{}
cache
=
get_cache
(
'default'
)
cache
=
caches
[
'default'
]
def
noop
(
*
args
,
**
kwargs
):
pass
...
...
@@ -620,7 +622,7 @@ class ConfigurationTestCase(SetupMixin, TestCase):
)
def
test_bad_parser_import
(
self
):
with
self
.
assertRaises
(
ImproperlyConfigured
):
get_cache
(
'default'
)
caches
[
'default'
]
@
override_settings
(
CACHES
=
{
...
...
tests/views.py
View file @
6e413f92
from
django.core.cache
import
get_cache
from
django.core.cache
import
caches
from
django.http
import
HttpResponse
def
someview
(
request
):
cache
=
get_cache
(
'redis_cache.cache://127.0.0.1'
)
cache
=
caches
[
'default'
]
cache
.
set
(
"foo"
,
"bar"
)
return
HttpResponse
(
"Pants"
)
\ No newline at end of file
return
HttpResponse
(
"Pants"
)
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