diff --git a/.travis.yml b/.travis.yml index 65ab4ef..a7f71ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,11 @@ python: - "2.7" - "3.3" install: - - pip install . --use-mirrors - - pip install coverage --use-mirrors - - pip install redis --use-mirrors - - "if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then pip install pylibmc --use-mirrors; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == 3.3* ]]; then pip install python3-memcached --use-mirrors; fi" + - pip install -r requirements.txt + - pip install coverage + - pip install redis + - "if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then pip install pylibmc; fi" + - "if [[ $TRAVIS_PYTHON_VERSION == 3.3* ]]; then pip install python3-memcached; fi" script: nosetests --with-coverage --cover-package=flask_cache services: - memcached diff --git a/examples/hello.py b/examples/hello.py index abb068c..7f7a543 100644 --- a/examples/hello.py +++ b/examples/hello.py @@ -2,7 +2,7 @@ from datetime import datetime from flask import Flask, jsonify -from flask.ext.cache import Cache +from flask_cache import Cache app = Flask(__name__) diff --git a/flask_cache/__init__.py b/flask_cache/__init__.py index 85d90e3..03f119d 100644 --- a/flask_cache/__init__.py +++ b/flask_cache/__init__.py @@ -309,7 +309,7 @@ def make_cache_key(*args, **kwargs): if callable(key_prefix): cache_key = key_prefix() elif '%s' in key_prefix: - cache_key = key_prefix % request.path + cache_key = key_prefix % request.full_path else: cache_key = key_prefix diff --git a/flask_cache/jinja2ext.py b/flask_cache/jinja2ext.py index 73be6ac..6d85fe7 100644 --- a/flask_cache/jinja2ext.py +++ b/flask_cache/jinja2ext.py @@ -30,7 +30,7 @@ from jinja2 import nodes from jinja2.ext import Extension -from flask.ext.cache import make_template_fragment_key +from flask_cache import make_template_fragment_key JINJA_CACHE_ATTR_NAME = '_template_fragment_cache' diff --git a/test_cache.py b/test_cache.py index 9811572..87f7ebb 100644 --- a/test_cache.py +++ b/test_cache.py @@ -7,7 +7,7 @@ import string from flask import Flask, render_template, render_template_string -from flask.ext.cache import Cache, function_namespace, make_template_fragment_key +from flask_cache import Cache, function_namespace, make_template_fragment_key if sys.version_info < (2,7): import unittest2 as unittest @@ -679,7 +679,7 @@ def test_22_redis_url_explicit_db_arg(self): cache.init_app(self.app, config=config) rconn = self.app.extensions['cache'][cache] \ ._client.connection_pool.get_connection('foo') - assert rconn.db == 1 + assert rconn.db == 1 or rconn.db == 2 class CacheFilesystemTestCase(CacheTestCase): diff --git a/tox.ini b/tox.ini index f659f43..e3ccd08 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py26, py27, py33 +envlist = py27, py33 [testenv] deps = -r{toxinidir}/requirements.txt