diff --git a/.travis.yml b/.travis.yml index a2d499f..1ca8a1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,6 @@ python: - "pypy" env: - - DJANGO=Django==1.4.17 - - DJANGO=Django==1.5.12 - DJANGO=Django==1.6.9 - DJANGO=Django==1.7.2 @@ -27,5 +25,10 @@ script: - PYTHONPATH=$PYTHONPATH:$PWD coverage run --source=defender $(which django-admin.py) test defender --settings=defender.travis_settings - coverage report -m +matrix: + exclude: + - python: "2.6" + env: DJANGO=Django==1.7.2 + after_success: - coveralls --verbose diff --git a/README.md b/README.md index 58427c6..e0d442a 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ to improve the login. requirements ============ -- django: 1.4.x, 1.5.x, 1.6.x, 1.7.x +- django: 1.6.x, 1.7.x - redis - python: 2.6.x, 2.7.x, 3.3.x, 3.4.x, PyPy diff --git a/defender/models.py b/defender/models.py index 2f38395..f721264 100644 --- a/defender/models.py +++ b/defender/models.py @@ -1,6 +1,10 @@ +from __future__ import unicode_literals + from django.db import models +from django.utils.encoding import python_2_unicode_compatible +@python_2_unicode_compatible class AccessAttempt(models.Model): user_agent = models.CharField( max_length=255, @@ -31,8 +35,8 @@ class AccessAttempt(models.Model): class Meta: ordering = ['-attempt_time'] - def __unicode__(self): + def __str__(self): """ unicode value for this model """ - return u"{0} @ {1} | {2}".format(self.username, - self.attempt_time, - self.login_valid) + return "{0} @ {1} | {2}".format(self.username, + self.attempt_time, + self.login_valid) diff --git a/defender/tests.py b/defender/tests.py index 68c9647..ba3e38a 100644 --- a/defender/tests.py +++ b/defender/tests.py @@ -32,7 +32,7 @@ def mock_get_connection(): # Django >= 1.7 compatibility try: - LOGIN_FORM_KEY = '