diff --git a/django/contrib/auth/tests/test_views.py b/django/contrib/auth/tests/test_views.py
index d406b43..85fe458 100644
a
|
b
|
from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME
|
10 | 10 | from django.contrib.auth.forms import (AuthenticationForm, PasswordChangeForm, |
11 | 11 | SetPasswordForm) |
12 | 12 | from django.contrib.auth.models import User |
13 | | from django.contrib.auth.views import login as login_view |
| 13 | from django.contrib.auth.views import login as login_view, redirect_to_login |
14 | 14 | from django.core import mail |
15 | | from django.core.urlresolvers import reverse, NoReverseMatch |
| 15 | from django.core.urlresolvers import NoReverseMatch, reverse, reverse_lazy |
16 | 16 | from django.http import QueryDict, HttpRequest |
17 | 17 | from django.utils.deprecation import RemovedInDjango20Warning |
18 | 18 | from django.utils.encoding import force_text |
… |
… |
class LoginRedirectUrlTest(AuthViewsTestCase):
|
673 | 673 | self.assertLoginRedirectURLEqual('http://remote.example.com/welcome/') |
674 | 674 | |
675 | 675 | |
| 676 | class LazyLoginURLTest(AuthViewsTestCase): |
| 677 | def test_redirect_to_login(self): |
| 678 | with self.settings(LOGIN_URL=reverse_lazy('login')): |
| 679 | login_redirect_response = redirect_to_login(next='/else/where/') |
| 680 | expected = '/login/?next=/else/where/' |
| 681 | self.assertEquals(expected, login_redirect_response.url) |
| 682 | |
| 683 | |
676 | 684 | @skipIfCustomUser |
677 | 685 | class LogoutTest(AuthViewsTestCase): |
678 | 686 | |