diff --git a/.travis.yml b/.travis.yml index 30b1164..943f5b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,6 @@ language: python python: - "2.7" env: - global: - - PIP_DOWNLOAD_CACHE=$HOME/.pip_cache matrix: - TOX_ENV=coverage - TOX_ENV=flake8 @@ -15,7 +13,7 @@ env: - TOX_ENV=py34-django19 cache: directories: - - $HOME/.pip-cache/ + - $HOME/.cache/pip/ - $HOME/build/nitmir/django-cas-server/.tox/ install: - "travis_retry pip install setuptools --upgrade" diff --git a/cas_server/tests/mixin.py b/cas_server/tests/mixin.py index 246a1c6..ff83258 100644 --- a/cas_server/tests/mixin.py +++ b/cas_server/tests/mixin.py @@ -161,7 +161,8 @@ class XmlContent(object): class UserModels(object): """Mixin for test on CAS user models""" - def expire_user(self): + @staticmethod + def expire_user(): """return an expired user""" client = get_auth_client() @@ -172,7 +173,8 @@ class UserModels(object): ).update(date=new_date) return client - def get_user(self, client): + @staticmethod + def get_user(client): """return the user associated with an authenticated client""" return models.User.objects.get( username=settings.CAS_TEST_USER, diff --git a/cas_server/tests/test_models.py b/cas_server/tests/test_models.py index d2f999e..5b001a7 100644 --- a/cas_server/tests/test_models.py +++ b/cas_server/tests/test_models.py @@ -94,8 +94,8 @@ class TicketTestCase(TestCase, UserModels, BaseServicePattern): ) models.ReplaceAttributName.objects.create(name="*", service_pattern=self.service_pattern) + @staticmethod def get_ticket( - self, user, ticket_class, service, diff --git a/tox.ini b/tox.ini index c2693d0..ad0fec7 100644 --- a/tox.ini +++ b/tox.ini @@ -15,11 +15,9 @@ exclude=migrations [base] deps = -r{toxinidir}/requirements-dev.txt -passenv=PIP_DOWNLOAD_CACHE [testenv] commands=py.test {posargs:cas_server/tests/} -passenv={[base]passenv} [testenv:py27-django17] basepython=python2.7 @@ -61,13 +59,10 @@ deps = basepython=python deps=flake8 commands=flake8 {toxinidir}/cas_server -passenv={[base]passenv} [testenv:coverage] basepython=python -passenv= - CODACY_PROJECT_TOKEN - {[base]passenv} +passenv=CODACY_PROJECT_TOKEN deps= -r{toxinidir}/requirements-dev.txt codacy-coverage