diff --git a/.gitignore b/.gitignore index 8c5e7b16..281fefd3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ django_password_reset.egg-info dist docs/_build +.idea *.pyc .tox build +password_reset.egg-info +.pytest_cache diff --git a/.travis.yml b/.travis.yml index 3cdcc094..8d965c91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,33 @@ language: python -python: "3.6" sudo: false cache: pip env: - - TOXENV=py27-django111 - - TOXENV=py34-django111 - - TOXENV=py35-django111 - - TOXENV=py36-django111 - - TOXENV=py34-django20 - - TOXENV=py35-django20 - - TOXENV=py36-django20 - - TOXENV=py35-django21 - - TOXENV=py36-django21 + - TOXENV=py38-django30 + - TOXENV=py39-django30 + - TOXENV=py310-django30 + - TOXENV=py38-django40 + - TOXENV=py39-django40 + - TOXENV=py310-django40 - TOXENV=docs - TOXENV=lint matrix: include: - - python: "3.5" - env: TOXENV=py35-django111 - - python: "3.5" - env: TOXENV=py35-django20 - - python: "3.5" - env: TOXENV=py35-django21 - exclude: - - python: "3.6" - env: TOXENV=py35-django111 - - python: "3.6" - env: TOXENV=py35-django20 - - python: "3.6" - env: TOXENV=py35-django21 + - python: "3.8" + env: TOXENV=py38-django30 + - python: "3.9" + env: TOXENV=py39-django30 + - python: "3.10" + env: TOXENV=py310-django30 + - python: "3.8" + env: TOXENV=py38-django40 + - python: "3.9" + env: TOXENV=py39-django40 + - python: "3.10" + env: TOXENV=py310-django40 + - python: "3.9" + env: TOXENV=docs + - python: "3.9" + env: TOXENV=lint install: - pip install tox script: diff --git a/README.rst b/README.rst index 2eb58290..ad6ba469 100644 --- a/README.rst +++ b/README.rst @@ -16,8 +16,8 @@ functionality. * Author: Bruno ReniƩ and `contributors`_ * Licence: BSD -* Compatibility: Django 1.11+ - +* Compatibility: Django 3+ +* Python 3+ .. _contributors: https://github.com/brutasse/django-password-reset/contributors Installation diff --git a/password_reset/tests/settings.py b/password_reset/tests/settings.py index 42b01387..33056610 100644 --- a/password_reset/tests/settings.py +++ b/password_reset/tests/settings.py @@ -26,3 +26,6 @@ ), }, }] + +USE_TZ = True +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' diff --git a/password_reset/tests/tests.py b/password_reset/tests/test_app.py similarity index 98% rename from password_reset/tests/tests.py rename to password_reset/tests/test_app.py index 2f922837..1c7abd04 100644 --- a/password_reset/tests/tests.py +++ b/password_reset/tests/test_app.py @@ -6,7 +6,6 @@ from django.test.utils import override_settings from django.urls import reverse from django.utils import timezone -from django.utils.six import with_metaclass from ..forms import PasswordRecoveryForm, PasswordResetForm from .models import CustomUser, ExtensionUser @@ -38,7 +37,7 @@ def create_user(): return get_user_model()._default_manager.create_user(*args, **kwargs) -class FormTests(with_metaclass(CustomUserVariants, TestCase)): +class FormTests(TestCase, metaclass=CustomUserVariants): def test_username_input(self): User = get_user_model() if User is CustomUser: @@ -199,7 +198,7 @@ def test_form_commit(self): user.password) -class ViewTests(with_metaclass(CustomUserVariants, TestCase)): +class ViewTests(TestCase, metaclass=CustomUserVariants): def test_recover(self): self.user = create_user() url = reverse('password_reset_recover') diff --git a/password_reset/tests/urls.py b/password_reset/tests/urls.py index 25832f3d..52851894 100644 --- a/password_reset/tests/urls.py +++ b/password_reset/tests/urls.py @@ -1,12 +1,12 @@ -from django.conf.urls import url +from django.urls import path from ..urls import urlpatterns from . import views urlpatterns += [ - url(r'^email_recover/$', views.email_recover, name='email_recover'), - url(r'^username_recover/$', views.username_recover, - name='username_recover'), - url(r'^insensitive_recover/$', views.insensitive_recover, - name='insensitive_recover'), + path('email_recover/', views.email_recover, name='email_recover'), + path('username_recover/', views.username_recover, + name='username_recover'), + path('insensitive_recover/', views.insensitive_recover, + name='insensitive_recover'), ] diff --git a/password_reset/urls.py b/password_reset/urls.py index 6b2e22c5..52394613 100644 --- a/password_reset/urls.py +++ b/password_reset/urls.py @@ -5,9 +5,9 @@ urlpatterns = [ path('recover//', views.recover_done, - name='password_reset_sent'), + name='password_reset_sent'), path('recover/', views.recover, name='password_reset_recover'), path('reset/done/', views.reset_done, name='password_reset_done'), path('reset//', views.reset, - name='password_reset_reset'), + name='password_reset_reset'), ] diff --git a/tox.ini b/tox.ini index 45c9cb9f..94213293 100644 --- a/tox.ini +++ b/tox.ini @@ -1,35 +1,32 @@ [tox] -envlist = - py27-django111, - py34-django{111,20}, - py35-django{111,20,21}, - py36-django{111,20,21}, +qenvlist = + py38-django{30,40}, + py39-django{30,40}, + py310-django{30,40}, docs, lint [testenv] -commands = python -Wall setup.py test +commands = python -Wall setup.py test # or your test command basepython = - py27: python2.7 - py34: python3.4 - py35: python3.5 - py36: python3.6 + py38: python3.8 + py39: python3.9 + py310: python3.10 deps = - django111: Django>=1.11,<2.0 - django20: Django>=2.0,<2.1 - django21: Django>=2.1,<2.2 + django30: Django>=3.0,<4.0 + django40: Django>=4.0,<5.0 [testenv:docs] -basepython = python3.6 +basepython = python3.9 changedir = docs deps = - Sphinx - sphinx_rtd_theme + Sphinx + sphinx_rtd_theme commands = - sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html + sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html [testenv:lint] -basepython = python3.6 +basepython = python3.9 deps = - flake8 + flake8 commands = - flake8 {toxinidir}/password_reset + flake8 {toxinidir}/password_reset