summaryrefslogtreecommitdiff
path: root/tests/auth_tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-03-07 13:43:17 -0500
committerTim Graham <timograham@gmail.com>2017-03-07 19:53:08 -0500
commit36d640cd1f00493688145dff2ae1c3f19efdb8e7 (patch)
treee889be7d431f2994a1c4b619df4a502a19dca76c /tests/auth_tests
parent89b31b312e030c83e674d0b5898b51a4a460778b (diff)
[1.11.x] Factored out uid/user tokens in auth_tests urlpatterns.
Backport of 72ff9d53e66d6b59ae5d8a1b830f5fc798eb75d0 from master
Diffstat (limited to 'tests/auth_tests')
-rw-r--r--tests/auth_tests/urls.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auth_tests/urls.py b/tests/auth_tests/urls.py
index 35bdbbb3a8..c1bb5aae49 100644
--- a/tests/auth_tests/urls.py
+++ b/tests/auth_tests/urls.py
@@ -62,6 +62,8 @@ def userpage(request):
pass
+uid_token = '(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[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<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[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<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[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<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[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/')),