diff --git a/tests/auth_tests/urls.py b/tests/auth_tests/urls.py index 392355f9b3..facfe4623f 100644 --- a/tests/auth_tests/urls.py +++ b/tests/auth_tests/urls.py @@ -62,6 +62,8 @@ def userpage(request): pass +uid_token = '(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})' + # special urls for auth test cases urlpatterns = auth_urlpatterns + [ url(r'^logout/custom_query/$', views.LogoutView.as_view(redirect_field_name='follow')), @@ -82,11 +84,11 @@ urlpatterns = auth_urlpatterns + [ views.PasswordResetView.as_view( html_email_template_name='registration/html_password_reset_email.html' )), - url(r'^reset/custom/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', + url(r'^reset/custom/{}/$'.format(uid_token), views.PasswordResetConfirmView.as_view(success_url='/custom/')), - url(r'^reset/custom/named/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', + url(r'^reset/custom/named/{}/$'.format(uid_token), views.PasswordResetConfirmView.as_view(success_url=reverse_lazy('password_reset'))), - url(r'^reset/post_reset_login/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', + url(r'^reset/post_reset_login/{}/$'.format(uid_token), views.PasswordResetConfirmView.as_view(post_reset_login=True)), url(r'^password_change/custom/$', views.PasswordChangeView.as_view(success_url='/custom/')),