diff --git a/ietf/ietfauth/tests.py b/ietf/ietfauth/tests.py index f6e6319d3..ab8375f17 100644 --- a/ietf/ietfauth/tests.py +++ b/ietf/ietfauth/tests.py @@ -24,7 +24,6 @@ from pyquery import PyQuery from unittest import skipIf from urllib.parse import urlsplit -import django.contrib.auth.views from django.urls import reverse as urlreverse from django.contrib.auth.models import User from django.conf import settings @@ -91,7 +90,7 @@ class IetfAuthTests(TestCase): self.assertEqual(urlsplit(r["Location"])[2], urlreverse(ietf.ietfauth.views.profile)) # try logging out - r = self.client.get(urlreverse(django.contrib.auth.views.logout)) + r = self.client.get(urlreverse('django.contrib.auth.views.logout')) self.assertEqual(r.status_code, 200) r = self.client.get(urlreverse(ietf.ietfauth.views.profile)) @@ -198,7 +197,7 @@ class IetfAuthTests(TestCase): self.assertContains(r, "Whitelist entry creation successful") # log out - r = self.client.get(urlreverse(django.contrib.auth.views.logout)) + r = self.client.get(urlreverse('django.contrib.auth.views.logout')) self.assertEqual(r.status_code, 200) # register and verify whitelisted email diff --git a/ietf/ietfauth/urls.py b/ietf/ietfauth/urls.py index d1b206c07..f31255542 100644 --- a/ietf/ietfauth/urls.py +++ b/ietf/ietfauth/urls.py @@ -1,7 +1,7 @@ # Copyright The IETF Trust 2007-2019, All Rights Reserved # Copyright The IETF Trust 2007, 2009, All Rights Reserved -from django.contrib.auth.views import logout # type: ignore +from django.contrib.auth.views import LogoutView # type: ignore from ietf.ietfauth import views from ietf.utils.urls import url @@ -15,7 +15,7 @@ urlpatterns = [ url(r'^create/$', views.create_account), url(r'^create/confirm/(?P[^/]+)/$', views.confirm_account), url(r'^login/$', views.login), - url(r'^logout/$', logout), + url(r'^logout/$', LogoutView.as_view(), name="django.contrib.auth.views.logout"), url(r'^password/$', views.change_password), url(r'^profile/$', views.profile), url(r'^reset/$', views.password_reset),