diff --git a/.coveragerc b/.coveragerc index b271c81..0df8e4b 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,2 +1,3 @@ [run] -source=axes +branch = True +source = axes diff --git a/.travis.yml b/.travis.yml index d99a75a..2585d18 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,8 @@ matrix: env: DJANGO=2.1 - python: 3.4 env: DJANGO=master + - python: 3.5 + env: DJANGO=master install: pip install tox-travis codecov script: tox after_success: diff --git a/axes/test_settings_cache.py b/axes/test_settings_cache.py deleted file mode 100644 index 88bb0b6..0000000 --- a/axes/test_settings_cache.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import unicode_literals - -from .test_settings import * # pylint: disable=unused-wildcard-import - -AXES_CACHE = 'axes' - -CACHES = { - 'axes': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache' - } -} diff --git a/runtests.py b/runtests.py deleted file mode 100755 index 89479c8..0000000 --- a/runtests.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python - -from __future__ import unicode_literals - -import os -import sys - -import django -from django.conf import settings -from django.core.exceptions import ImproperlyConfigured -from django.test.utils import get_runner - - -def run_tests(): - os.environ['DJANGO_SETTINGS_MODULE'] = 'axes.test_settings' - django.setup() - TestRunner = get_runner(settings) - test_runner = TestRunner() - failures = test_runner.run_tests(['axes.tests']) - sys.exit(bool(failures)) - - -def run_tests_cache(): - """Check that using a wrong cache backend (LocMemCache) throws correctly - - This is due to LocMemCache not working with AccessAttempt caching, - please see issue https://github.com/jazzband/django-axes/issues/288 - """ - - try: - os.environ['DJANGO_SETTINGS_MODULE'] = 'axes.test_settings_cache' - django.setup() - print('Using LocMemCache as a cache backend does not throw') - sys.exit(1) - except ImproperlyConfigured: - print('Using LocMemCache as a cache backend throws correctly') - sys.exit(0) - - -if __name__ == '__main__': - if 'cache' in sys.argv: - run_tests_cache() - run_tests() diff --git a/tox.ini b/tox.ini index f489c99..f8c7767 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = py{27,34,35,36,37}-django111 py{34,35,36,37}-django20 py{35,36,37}-django21 - py{35,36,37}-djangomaster + py{36,37}-djangomaster [travis] python = @@ -31,8 +31,7 @@ usedevelop = True ignore_outcome = djangomaster: True commands = - coverage run -a runtests.py -v2 - coverage run -a runtests.py -v2 cache + coverage run -a manage.py test -v2 coverage report prospector setenv =