Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Django 4.0 #4

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ python:
- '3.4'
- '3.5'
- '3.6'
- '3.7'
- '3.8'
- '3.9'

matrix:
include:
Expand Down
7 changes: 6 additions & 1 deletion allauth_cas/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# -*- coding: utf-8 -*-
import django
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _

if django.VERSION >= (2, 0):
from django.utils.translation import gettext_lazy as _
else:
from django.utils.translation import ugettext_lazy as _


class CASAccountConfig(AppConfig):
Expand Down
8 changes: 7 additions & 1 deletion allauth_cas/urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# -*- coding: utf-8 -*-
from django.conf.urls import include, url
import django

if django.VERSION >= (2, 0):
from django.urls import include, re_path as url
else:
from django.conf.urls import include, url

from django.utils.module_loading import import_string


Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 4.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
Expand All @@ -38,6 +39,9 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Internet :: WWW/HTTP',
],
license='MIT',
Expand Down
4 changes: 2 additions & 2 deletions tests/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def setUp(self):

def _get_request(self):
request = RequestFactory().get('/test/')
SessionMiddleware().process_request(request)
MessageMiddleware().process_request(request)
SessionMiddleware(lambda: None).process_request(request)
MessageMiddleware(lambda: None).process_request(request)
return request

def test_register(self):
Expand Down
8 changes: 7 additions & 1 deletion tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# -*- coding: utf-8 -*-
from django.conf.urls import include, url
import django

if django.VERSION >= (2, 0):
from django.urls import include, re_path as url
else:
from django.conf.urls import include, url

urlpatterns = [
url(r'^example/', include('tests.example.urls')),
url(r'^accounts/', include('allauth.urls')),
]
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ envlist =
django110-py{27,34,35},
django111-py{27,34,35,36},
django20-py{34,35,36},
django40-py{37,38,39}

cov_combine,
flake8,
Expand All @@ -19,6 +20,7 @@ deps =
django110: django>=1.10,<1.11
django111: django>=1.11,<2.0
django20: django>=2.0,<2.1
django40: django>=4.0,<4.1

coverage
mock ; python_version < "3.0"
Expand Down