Exemplo n.º 1
0
    def test_confirm_login_url_resolves(self):
        complete_view = PasswordResetCompleteView.as_view(login_url='login_required')
        request_factory = RequestFactory()
        response = complete_view(request_factory.get('/xxx/'))
        self.assertEqual(response.context_data['login_url'], reverse('login_required'))

        complete_view2 = PasswordResetCompleteView.as_view(login_url='/dont-change-me/')
        response = complete_view2(request_factory.get('/xxx/'))
        self.assertEqual(response.context_data['login_url'], '/dont-change-me/')
Exemplo n.º 2
0
    def test_confirm_login_url_resolves(self):
        complete_view = PasswordResetCompleteView.as_view(
            login_url='login_required')
        request_factory = RequestFactory()
        response = complete_view(request_factory.get('/xxx/'))
        self.assertEqual(response.context_data['login_url'],
                         reverse('login_required'))

        complete_view2 = PasswordResetCompleteView.as_view(
            login_url='/dont-change-me/')
        response = complete_view2(request_factory.get('/xxx/'))
        self.assertEqual(response.context_data['login_url'],
                         '/dont-change-me/')
Exemplo n.º 3
0
         name='login'),
    path('', RedirectView.as_view(url='login/')),
    path('logout/',
         LogoutView.as_view(template_name='users/logout.html'),
         name='logout'),
    path('signup/', views.SignUp.as_view(), name='signup'),

    # change password
    path('password_change/',
         views.PasswordChange.as_view(),
         name='password_change'),
    path('password_change/done/',
         PasswordChangeDoneView.as_view(
             template_name='users/password_change_done.html'),
         name='password_change_done'),

    # reset password
    path('password_reset/', views.ResetView.as_view(), name='password_reset'),
    path('password_reset/done/',
         PasswordResetDoneView.as_view(
             template_name='users/password_reset_done.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         views.ResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('reset/done/',
         PasswordResetCompleteView.as_view(
             template_name='users/password_reset_complete.html'),
         name='password_reset_complete'),
]
Exemplo n.º 4
0
    url(r'^logout/$', LogoutView.as_view(pattern_name='login'), name='logout'),
    url(
        r'^change-password/$', PasswordChangeView.as_view(
            template_name='accounts/change_password.html',
            success_url=reverse_lazy('dashboard'),
        ), name='password-change',
    ),
    url(r'^password-reset/$', PasswordResetView.as_view(), name='password-reset'),
    url(
        r'^password-reset-done/$', PasswordResetDoneView.as_view(),
        name='password-reset-done',
    ),
    url(
        r'^password-reset-done/$', PasswordResetDoneView.as_view(),
        name='password_reset_done',  # authtools uses underscore view names.
    ),
    url(
        r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        PasswordResetConfirmAndLoginView.as_view(),
        name='password-reset-confirm-and-login',
    ),
    url(
        r'^password-reset-complete/$', PasswordResetCompleteView.as_view(),
        name='password-reset-complete',
    ),
    url(
        r'^password-reset-complete/$', PasswordResetCompleteView.as_view(),
        name='password_reset_complete',  # authtools uses underscore view names.
    ),
)