diff --git a/requirements/optionals.txt b/requirements/optionals.txt index 7ce28e34..1a1c4ad4 100644 --- a/requirements/optionals.txt +++ b/requirements/optionals.txt @@ -1,4 +1,5 @@ -django-allauth<0.55.0 # breaking change breaking dj-rest-auth +django-allauth>=0.56.0; python_version >= '3.7' +django-allauth<0.55.0; python_version < '3.7' drf-jwt>=0.13.0 dj-rest-auth>=1.0.0 djangorestframework-simplejwt>=4.4.0 diff --git a/tests/conftest.py b/tests/conftest.py index c46e4892..d928f660 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -32,6 +32,11 @@ def pytest_configure(config): if is_gis_installed(): contrib_apps.append('rest_framework_gis') + contrib_middleware = [] + + if module_available('allauth.account.middleware'): + contrib_middleware.append('allauth.account.middleware.AccountMiddleware') + base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) settings.configure( @@ -70,6 +75,7 @@ def pytest_configure(config): 'django.middleware.common.CommonMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.locale.LocaleMiddleware', + *contrib_middleware, ), INSTALLED_APPS=( 'django.contrib.auth',