How to use reset method in Playwright Internal

Best JavaScript code snippet using playwright-internal

Run Playwright Internal automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

passwords.py

Source: passwords.py Github

copy
1# coding=utf-8
2from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm
3from django.contrib.auth.tokens import default_token_generator
4from django.contrib.auth.views import PasswordResetConfirmView as password_reset_confirm
5from django.template.response import TemplateResponse
6from django.utils.translation import ugettext as _
7
8from xadmin.sites import site
9from xadmin.views.base import BaseAdminPlugin, BaseAdminView, csrf_protect_m
10from xadmin.views.website import LoginView
11
12
13class ResetPasswordSendView(BaseAdminView):
14
15    need_site_permission = False
16
17    password_reset_form = PasswordResetForm
18    password_reset_template = 'xadmin/auth/password_reset/form.html'
19    password_reset_done_template = 'xadmin/auth/password_reset/done.html'
20    password_reset_token_generator = default_token_generator
21
22    password_reset_from_email = None
23    password_reset_email_template = 'xadmin/auth/password_reset/email.html'
24    password_reset_subject_template = None
25
26    def get(self, request, *args, **kwargs):
27        context = super(ResetPasswordSendView, self).get_context()
28        context['form'] = kwargs.get('form', self.password_reset_form())
29
30        return TemplateResponse(request, self.password_reset_template, context)
31
32    @csrf_protect_m
33    def post(self, request, *args, **kwargs):
34        form = self.password_reset_form(request.POST)
35
36        if form.is_valid():
37            opts = {
38                'use_https': request.is_secure(),
39                'token_generator': self.password_reset_token_generator,
40                'email_template_name': self.password_reset_email_template,
41                'request': request,
42                'domain_override': request.get_host()
43            }
44
45            if self.password_reset_from_email:
46                opts['from_email'] = self.password_reset_from_email
47            if self.password_reset_subject_template:
48                opts['subject_template_name'] = self.password_reset_subject_template
49
50            form.save(**opts)
51            context = super(ResetPasswordSendView, self).get_context()
52            return TemplateResponse(request, self.password_reset_done_template, context)
53        else:
54            return self.get(request, form=form)
55
56
57site.register_view(r'^xadmin/password_reset/$', ResetPasswordSendView, name='xadmin_password_reset')
58
59
60class ResetLinkPlugin(BaseAdminPlugin):
61
62    def block_form_bottom(self, context, nodes):
63        reset_link = self.get_admin_url('xadmin_password_reset')
64        return '<div class="text-info" style="margin-top:15px;"><a href="%s"><i class="fa fa-question-sign"></i> %s</a></div>' % (reset_link, _('Forgotten your password or username?'))
65
66
67site.register_plugin(ResetLinkPlugin, LoginView)
68
69
70class ResetPasswordComfirmView(BaseAdminView):
71
72    need_site_permission = False
73
74    password_reset_set_form = SetPasswordForm
75    password_reset_confirm_template = 'xadmin/auth/password_reset/confirm.html'
76    password_reset_token_generator = default_token_generator
77
78    def do_view(self, request, uidb36, token, *args, **kwargs):
79        context = super(ResetPasswordComfirmView, self).get_context()
80        return password_reset_confirm(request, uidb36, token,
81                                      template_name=self.password_reset_confirm_template,
82                                      token_generator=self.password_reset_token_generator,
83                                      set_password_form=self.password_reset_set_form,
84                                      post_reset_redirect=self.get_admin_url('xadmin_password_reset_complete'),
85                                      current_app=self.admin_site.name, extra_context=context)
86
87    def get(self, request, uidb36, token, *args, **kwargs):
88        return self.do_view(request, uidb36, token)
89
90    def post(self, request, uidb36, token, *args, **kwargs):
91        return self.do_view(request, uidb36, token)
92
93    def get_media(self):
94        return super(ResetPasswordComfirmView, self).get_media() + \
95            self.vendor('xadmin.page.form.js', 'xadmin.form.css')
96
97
98site.register_view(r'^xadmin/password_reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
99                   ResetPasswordComfirmView, name='xadmin_password_reset_confirm')
100
101
102class ResetPasswordCompleteView(BaseAdminView):
103
104    need_site_permission = False
105
106    password_reset_complete_template = 'xadmin/auth/password_reset/complete.html'
107
108    def get(self, request, *args, **kwargs):
109        context = super(ResetPasswordCompleteView, self).get_context()
110        context['login_url'] = self.get_admin_url('index')
111
112        return TemplateResponse(request, self.password_reset_complete_template, context)
113
114
115site.register_view(r'^xadmin/password_reset/complete/$', ResetPasswordCompleteView, name='xadmin_password_reset_complete')
116
Full Screen

zynqmp_pm_cfg_obj_convert.py

Source: zynqmp_pm_cfg_obj_convert.py Github

copy
1#!/usr/bin/env python3
2# SPDX-License-Identifier: GPL-2.0+
3# Copyright (C) 2019 Luca Ceresoli <[email protected]>
4
5import sys
6import re
7import struct
8import logging
9import argparse
10
11parser = argparse.ArgumentParser(
12    description='Convert a PMU configuration object from C source to a binary blob.')
13parser.add_argument('-D', '--debug', action="store_true")
14parser.add_argument(
15    "in_file", metavar='INPUT_FILE',
16    help='PMU configuration object (C source as produced by Xilinx XSDK)')
17parser.add_argument(
18    "out_file", metavar='OUTPUT_FILE',
19    help='PMU configuration object binary blob')
20args = parser.parse_args()
21
22logging.basicConfig(format='%(levelname)s:%(message)s',
23                    level=(logging.DEBUG if args.debug else logging.WARNING))
24
25pm_define = {
26    'PM_CAP_ACCESS'   : 0x1,
27    'PM_CAP_CONTEXT'  : 0x2,
28    'PM_CAP_WAKEUP'   : 0x4,
29
30    'NODE_UNKNOWN'    :  0,
31    'NODE_APU'        :  1,
32    'NODE_APU_0'      :  2,
33    'NODE_APU_1'      :  3,
34    'NODE_APU_2'      :  4,
35    'NODE_APU_3'      :  5,
36    'NODE_RPU'        :  6,
37    'NODE_RPU_0'      :  7,
38    'NODE_RPU_1'      :  8,
39    'NODE_PLD'        :  9,
40    'NODE_FPD'        : 10,
41    'NODE_OCM_BANK_0' : 11,
42    'NODE_OCM_BANK_1' : 12,
43    'NODE_OCM_BANK_2' : 13,
44    'NODE_OCM_BANK_3' : 14,
45    'NODE_TCM_0_A'    : 15,
46    'NODE_TCM_0_B'    : 16,
47    'NODE_TCM_1_A'    : 17,
48    'NODE_TCM_1_B'    : 18,
49    'NODE_L2'         : 19,
50    'NODE_GPU_PP_0'   : 20,
51    'NODE_GPU_PP_1'   : 21,
52    'NODE_USB_0'      : 22,
53    'NODE_USB_1'      : 23,
54    'NODE_TTC_0'      : 24,
55    'NODE_TTC_1'      : 25,
56    'NODE_TTC_2'      : 26,
57    'NODE_TTC_3'      : 27,
58    'NODE_SATA'       : 28,
59    'NODE_ETH_0'      : 29,
60    'NODE_ETH_1'      : 30,
61    'NODE_ETH_2'      : 31,
62    'NODE_ETH_3'      : 32,
63    'NODE_UART_0'     : 33,
64    'NODE_UART_1'     : 34,
65    'NODE_SPI_0'      : 35,
66    'NODE_SPI_1'      : 36,
67    'NODE_I2C_0'      : 37,
68    'NODE_I2C_1'      : 38,
69    'NODE_SD_0'       : 39,
70    'NODE_SD_1'       : 40,
71    'NODE_DP'         : 41,
72    'NODE_GDMA'       : 42,
73    'NODE_ADMA'       : 43,
74    'NODE_NAND'       : 44,
75    'NODE_QSPI'       : 45,
76    'NODE_GPIO'       : 46,
77    'NODE_CAN_0'      : 47,
78    'NODE_CAN_1'      : 48,
79    'NODE_EXTERN'     : 49,
80    'NODE_APLL'       : 50,
81    'NODE_VPLL'       : 51,
82    'NODE_DPLL'       : 52,
83    'NODE_RPLL'       : 53,
84    'NODE_IOPLL'      : 54,
85    'NODE_DDR'        : 55,
86    'NODE_IPI_APU'    : 56,
87    'NODE_IPI_RPU_0'  : 57,
88    'NODE_GPU'        : 58,
89    'NODE_PCIE'       : 59,
90    'NODE_PCAP'       : 60,
91    'NODE_RTC'        : 61,
92    'NODE_LPD'        : 62,
93    'NODE_VCU'        : 63,
94    'NODE_IPI_RPU_1'  : 64,
95    'NODE_IPI_PL_0'   : 65,
96    'NODE_IPI_PL_1'   : 66,
97    'NODE_IPI_PL_2'   : 67,
98    'NODE_IPI_PL_3'   : 68,
99    'NODE_PL'         : 69,
100    'NODE_ID_MA'      : 70,
101
102    'XILPM_RESET_PCIE_CFG'         : 1000,
103    'XILPM_RESET_PCIE_BRIDGE'      : 1001,
104    'XILPM_RESET_PCIE_CTRL'        : 1002,
105    'XILPM_RESET_DP'               : 1003,
106    'XILPM_RESET_SWDT_CRF'         : 1004,
107    'XILPM_RESET_AFI_FM5'          : 1005,
108    'XILPM_RESET_AFI_FM4'          : 1006,
109    'XILPM_RESET_AFI_FM3'          : 1007,
110    'XILPM_RESET_AFI_FM2'          : 1008,
111    'XILPM_RESET_AFI_FM1'          : 1009,
112    'XILPM_RESET_AFI_FM0'          : 1010,
113    'XILPM_RESET_GDMA'             : 1011,
114    'XILPM_RESET_GPU_PP1'          : 1012,
115    'XILPM_RESET_GPU_PP0'          : 1013,
116    'XILPM_RESET_GPU'              : 1014,
117    'XILPM_RESET_GT'               : 1015,
118    'XILPM_RESET_SATA'             : 1016,
119    'XILPM_RESET_ACPU3_PWRON'      : 1017,
120    'XILPM_RESET_ACPU2_PWRON'      : 1018,
121    'XILPM_RESET_ACPU1_PWRON'      : 1019,
122    'XILPM_RESET_ACPU0_PWRON'      : 1020,
123    'XILPM_RESET_APU_L2'           : 1021,
124    'XILPM_RESET_ACPU3'            : 1022,
125    'XILPM_RESET_ACPU2'            : 1023,
126    'XILPM_RESET_ACPU1'            : 1024,
127    'XILPM_RESET_ACPU0'            : 1025,
128    'XILPM_RESET_DDR'              : 1026,
129    'XILPM_RESET_APM_FPD'          : 1027,
130    'XILPM_RESET_SOFT'             : 1028,
131    'XILPM_RESET_GEM0'             : 1029,
132    'XILPM_RESET_GEM1'             : 1030,
133    'XILPM_RESET_GEM2'             : 1031,
134    'XILPM_RESET_GEM3'             : 1032,
135    'XILPM_RESET_QSPI'             : 1033,
136    'XILPM_RESET_UART0'            : 1034,
137    'XILPM_RESET_UART1'            : 1035,
138    'XILPM_RESET_SPI0'             : 1036,
139    'XILPM_RESET_SPI1'             : 1037,
140    'XILPM_RESET_SDIO0'            : 1038,
141    'XILPM_RESET_SDIO1'            : 1039,
142    'XILPM_RESET_CAN0'             : 1040,
143    'XILPM_RESET_CAN1'             : 1041,
144    'XILPM_RESET_I2C0'             : 1042,
145    'XILPM_RESET_I2C1'             : 1043,
146    'XILPM_RESET_TTC0'             : 1044,
147    'XILPM_RESET_TTC1'             : 1045,
148    'XILPM_RESET_TTC2'             : 1046,
149    'XILPM_RESET_TTC3'             : 1047,
150    'XILPM_RESET_SWDT_CRL'         : 1048,
151    'XILPM_RESET_NAND'             : 1049,
152    'XILPM_RESET_ADMA'             : 1050,
153    'XILPM_RESET_GPIO'             : 1051,
154    'XILPM_RESET_IOU_CC'           : 1052,
155    'XILPM_RESET_TIMESTAMP'        : 1053,
156    'XILPM_RESET_RPU_R50'          : 1054,
157    'XILPM_RESET_RPU_R51'          : 1055,
158    'XILPM_RESET_RPU_AMBA'         : 1056,
159    'XILPM_RESET_OCM'              : 1057,
160    'XILPM_RESET_RPU_PGE'          : 1058,
161    'XILPM_RESET_USB0_CORERESET'   : 1059,
162    'XILPM_RESET_USB1_CORERESET'   : 1060,
163    'XILPM_RESET_USB0_HIBERRESET'  : 1061,
164    'XILPM_RESET_USB1_HIBERRESET'  : 1062,
165    'XILPM_RESET_USB0_APB'         : 1063,
166    'XILPM_RESET_USB1_APB'         : 1064,
167    'XILPM_RESET_IPI'              : 1065,
168    'XILPM_RESET_APM_LPD'          : 1066,
169    'XILPM_RESET_RTC'              : 1067,
170    'XILPM_RESET_SYSMON'           : 1068,
171    'XILPM_RESET_AFI_FM6'          : 1069,
172    'XILPM_RESET_LPD_SWDT'         : 1070,
173    'XILPM_RESET_FPD'              : 1071,
174    'XILPM_RESET_RPU_DBG1'         : 1072,
175    'XILPM_RESET_RPU_DBG0'         : 1073,
176    'XILPM_RESET_DBG_LPD'          : 1074,
177    'XILPM_RESET_DBG_FPD'          : 1075,
178    'XILPM_RESET_APLL'             : 1076,
179    'XILPM_RESET_DPLL'             : 1077,
180    'XILPM_RESET_VPLL'             : 1078,
181    'XILPM_RESET_IOPLL'            : 1079,
182    'XILPM_RESET_RPLL'             : 1080,
183    'XILPM_RESET_GPO3_PL_0'        : 1081,
184    'XILPM_RESET_GPO3_PL_1'        : 1082,
185    'XILPM_RESET_GPO3_PL_2'        : 1083,
186    'XILPM_RESET_GPO3_PL_3'        : 1084,
187    'XILPM_RESET_GPO3_PL_4'        : 1085,
188    'XILPM_RESET_GPO3_PL_5'        : 1086,
189    'XILPM_RESET_GPO3_PL_6'        : 1087,
190    'XILPM_RESET_GPO3_PL_7'        : 1088,
191    'XILPM_RESET_GPO3_PL_8'        : 1089,
192    'XILPM_RESET_GPO3_PL_9'        : 1090,
193    'XILPM_RESET_GPO3_PL_10'       : 1091,
194    'XILPM_RESET_GPO3_PL_11'       : 1092,
195    'XILPM_RESET_GPO3_PL_12'       : 1093,
196    'XILPM_RESET_GPO3_PL_13'       : 1094,
197    'XILPM_RESET_GPO3_PL_14'       : 1095,
198    'XILPM_RESET_GPO3_PL_15'       : 1096,
199    'XILPM_RESET_GPO3_PL_16'       : 1097,
200    'XILPM_RESET_GPO3_PL_17'       : 1098,
201    'XILPM_RESET_GPO3_PL_18'       : 1099,
202    'XILPM_RESET_GPO3_PL_19'       : 1100,
203    'XILPM_RESET_GPO3_PL_20'       : 1101,
204    'XILPM_RESET_GPO3_PL_21'       : 1102,
205    'XILPM_RESET_GPO3_PL_22'       : 1103,
206    'XILPM_RESET_GPO3_PL_23'       : 1104,
207    'XILPM_RESET_GPO3_PL_24'       : 1105,
208    'XILPM_RESET_GPO3_PL_25'       : 1106,
209    'XILPM_RESET_GPO3_PL_26'       : 1107,
210    'XILPM_RESET_GPO3_PL_27'       : 1108,
211    'XILPM_RESET_GPO3_PL_28'       : 1109,
212    'XILPM_RESET_GPO3_PL_29'       : 1110,
213    'XILPM_RESET_GPO3_PL_30'       : 1111,
214    'XILPM_RESET_GPO3_PL_31'       : 1112,
215    'XILPM_RESET_RPU_LS'           : 1113,
216    'XILPM_RESET_PS_ONLY'          : 1114,
217    'XILPM_RESET_PL'               : 1115,
218    'XILPM_RESET_GPIO5_EMIO_92'    : 1116,
219    'XILPM_RESET_GPIO5_EMIO_93'    : 1117,
220    'XILPM_RESET_GPIO5_EMIO_94'    : 1118,
221    'XILPM_RESET_GPIO5_EMIO_95'    : 1119,
222
223    'PM_CONFIG_MASTER_SECTION_ID'        : 0x101,
224    'PM_CONFIG_SLAVE_SECTION_ID'         : 0x102,
225    'PM_CONFIG_PREALLOC_SECTION_ID'      : 0x103,
226    'PM_CONFIG_POWER_SECTION_ID'         : 0x104,
227    'PM_CONFIG_RESET_SECTION_ID'         : 0x105,
228    'PM_CONFIG_SHUTDOWN_SECTION_ID'      : 0x106,
229    'PM_CONFIG_SET_CONFIG_SECTION_ID'    : 0x107,
230    'PM_CONFIG_GPO_SECTION_ID'           : 0x108,
231
232    'PM_SLAVE_FLAG_IS_SHAREABLE'         : 0x1,
233    'PM_MASTER_USING_SLAVE_MASK'         : 0x2,
234
235    'PM_CONFIG_GPO1_MIO_PIN_34_MAP'      : (1 << 10),
236    'PM_CONFIG_GPO1_MIO_PIN_35_MAP'      : (1 << 11),
237    'PM_CONFIG_GPO1_MIO_PIN_36_MAP'      : (1 << 12),
238    'PM_CONFIG_GPO1_MIO_PIN_37_MAP'      : (1 << 13),
239
240    'PM_CONFIG_GPO1_BIT_2_MASK'          : (1 << 2),
241    'PM_CONFIG_GPO1_BIT_3_MASK'          : (1 << 3),
242    'PM_CONFIG_GPO1_BIT_4_MASK'          : (1 << 4),
243    'PM_CONFIG_GPO1_BIT_5_MASK'          : (1 << 5),
244
245    'SUSPEND_TIMEOUT'                    : 0xFFFFFFFF,
246
247    'PM_CONFIG_IPI_PSU_CORTEXA53_0_MASK' : 0x00000001,
248    'PM_CONFIG_IPI_PSU_CORTEXR5_0_MASK'  : 0x00000100,
249    'PM_CONFIG_IPI_PSU_CORTEXR5_1_MASK'  : 0x00000200,
250}
251
252in_file  = open(args.in_file,  mode='r')
253out_file = open(args.out_file, mode='wb')
254
255num_re   = re.compile(r"^([0-9]+)U?$")
256const_re = re.compile(r"^([A-Z_][A-Z0-9_]*)$")
257
258def process_item(item):
259    logging.debug("* ITEM   " + item)
260
261    value = 0
262    for item in item.split('|'):
263        item = item.strip()
264
265        num_match   = num_re  .match(item)
266        const_match = const_re.match(item)
267
268        if num_match:
269            num = int(num_match.group(1))
270            logging.debug("  - num  " + str(num))
271            value |= num
272        elif const_match:
273            name = const_match.group(1)
274            if not name in pm_define:
275                sys.stderr.write("Unknown define " + name + "!\n")
276                exit(1)
277            num = pm_define[name]
278            logging.debug("  - def  " + hex(num))
279            value |= num
280
281    logging.debug("  = res  " + hex(value))
282    out_file.write(struct.pack('<L', value))
283
284
285# Read all code
286code = in_file.read()
287
288# remove comments
289code = re.sub('//.*?\n|/\*.*?\*/', '', code, flags=re.DOTALL)
290
291# remove everything outside the XPm_ConfigObject array definition
292code = re.search('const u32 XPm_ConfigObject.*= {\n(.*)};',
293                 code, flags=re.DOTALL).group(1)
294
295# Process each comma-separated array item
296for item in code.split(','):
297    item = item.strip()
298    if item:
299        process_item(item)
300
301print("Wrote %d bytes" % out_file.tell())
302
Full Screen

test_reset_password.py

Source: test_reset_password.py Github

copy
1"""
2Test the various password reset flows
3"""
4import json
5import re
6import unittest
7
8from django.core.cache import cache
9from django.conf import settings
10from django.test import TestCase
11from django.test.client import RequestFactory
12from django.contrib.auth.models import User
13from django.contrib.auth.hashers import UNUSABLE_PASSWORD
14from django.contrib.auth.tokens import default_token_generator
15from django.utils.http import int_to_base36
16
17from mock import Mock, patch
18import ddt
19
20from student.views import password_reset, password_reset_confirm_wrapper
21from student.tests.factories import UserFactory
22from student.tests.test_email import mock_render_to_string
23
24
25@ddt.ddt
26class ResetPasswordTests(TestCase):
27    """ Tests that clicking reset password sends email, and doesn't activate the user
28    """
29    request_factory = RequestFactory()
30
31    def setUp(self):
32        self.user = UserFactory.create()
33        self.user.is_active = False
34        self.user.save()
35        self.token = default_token_generator.make_token(self.user)
36        self.uidb36 = int_to_base36(self.user.id)
37
38        self.user_bad_passwd = UserFactory.create()
39        self.user_bad_passwd.is_active = False
40        self.user_bad_passwd.password = UNUSABLE_PASSWORD
41        self.user_bad_passwd.save()
42
43    @patch('student.views.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
44    def test_user_bad_password_reset(self):
45        """Tests password reset behavior for user with password marked UNUSABLE_PASSWORD"""
46
47        bad_pwd_req = self.request_factory.post('/password_reset/', {'email': self.user_bad_passwd.email})
48        bad_pwd_resp = password_reset(bad_pwd_req)
49        # If they've got an unusable password, we return a successful response code
50        self.assertEquals(bad_pwd_resp.status_code, 200)
51        obj = json.loads(bad_pwd_resp.content)
52        self.assertEquals(obj, {
53            'success': True,
54            'value': "('registration/password_reset_done.html', [])",
55        })
56
57    @patch('student.views.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
58    def test_nonexist_email_password_reset(self):
59        """Now test the exception cases with of reset_password called with invalid email."""
60
61        bad_email_req = self.request_factory.post('/password_reset/', {'email': self.user.email + "makeItFail"})
62        bad_email_resp = password_reset(bad_email_req)
63        # Note: even if the email is bad, we return a successful response code
64        # This prevents someone potentially trying to "brute-force" find out which
65        # emails are and aren't registered with edX
66        self.assertEquals(bad_email_resp.status_code, 200)
67        obj = json.loads(bad_email_resp.content)
68        self.assertEquals(obj, {
69            'success': True,
70            'value': "('registration/password_reset_done.html', [])",
71        })
72
73    @patch('student.views.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
74    def test_password_reset_ratelimited(self):
75        """ Try (and fail) resetting password 30 times in a row on an non-existant email address """
76        cache.clear()
77
78        for i in xrange(30):
79            good_req = self.request_factory.post('/password_reset/', {
80                'email': 'thisdoesnotexist{0}@foo.com'.format(i)
81            })
82            good_resp = password_reset(good_req)
83            self.assertEquals(good_resp.status_code, 200)
84
85        # then the rate limiter should kick in and give a HttpForbidden response
86        bad_req = self.request_factory.post('/password_reset/', {'email': '[email protected]'})
87        bad_resp = password_reset(bad_req)
88        self.assertEquals(bad_resp.status_code, 403)
89
90        cache.clear()
91
92    @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', "Test only valid in LMS")
93    @patch('django.core.mail.send_mail')
94    @patch('student.views.render_to_string', Mock(side_effect=mock_render_to_string, autospec=True))
95    def test_reset_password_email(self, send_email):
96        """Tests contents of reset password email, and that user is not active"""
97
98        good_req = self.request_factory.post('/password_reset/', {'email': self.user.email})
99        good_resp = password_reset(good_req)
100        self.assertEquals(good_resp.status_code, 200)
101        obj = json.loads(good_resp.content)
102        self.assertEquals(obj, {
103            'success': True,
104            'value': "('registration/password_reset_done.html', [])",
105        })
106
107        (subject, msg, from_addr, to_addrs) = send_email.call_args[0]
108        self.assertIn("Password reset", subject)
109        self.assertIn("You're receiving this e-mail because you requested a password reset", msg)
110        self.assertEquals(from_addr, settings.DEFAULT_FROM_EMAIL)
111        self.assertEquals(len(to_addrs), 1)
112        self.assertIn(self.user.email, to_addrs)
113
114        #test that the user is not active
115        self.user = User.objects.get(pk=self.user.pk)
116        self.assertFalse(self.user.is_active)
117        re.search(r'password_reset_confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/', msg).groupdict()
118
119    @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', "Test only valid in LMS")
120    @patch('django.core.mail.send_mail')
121    @ddt.data((False, 'http://'), (True, 'https://'))
122    @ddt.unpack
123    def test_reset_password_email_https(self, is_secure, protocol, send_email):
124        """
125        Tests that the right url protocol is included in the reset password link
126        """
127        req = self.request_factory.post(
128            '/password_reset/', {'email': self.user.email}
129        )
130        req.is_secure = Mock(return_value=is_secure)
131        resp = password_reset(req)
132        _, msg, _, _ = send_email.call_args[0]
133        expected_msg = "Please go to the following page and choose a new password:\n\n" + protocol
134
135        self.assertIn(expected_msg, msg)
136
137    @patch('student.views.password_reset_confirm')
138    def test_reset_password_bad_token(self, reset_confirm):
139        """Tests bad token and uidb36 in password reset"""
140
141        bad_reset_req = self.request_factory.get('/password_reset_confirm/NO-OP/')
142        password_reset_confirm_wrapper(bad_reset_req, 'NO', 'OP')
143        confirm_kwargs = reset_confirm.call_args[1]
144        self.assertEquals(confirm_kwargs['uidb36'], 'NO')
145        self.assertEquals(confirm_kwargs['token'], 'OP')
146        self.user = User.objects.get(pk=self.user.pk)
147        self.assertFalse(self.user.is_active)
148
149    @patch('student.views.password_reset_confirm')
150    def test_reset_password_good_token(self, reset_confirm):
151        """Tests good token and uidb36 in password reset"""
152
153        good_reset_req = self.request_factory.get('/password_reset_confirm/{0}-{1}/'.format(self.uidb36, self.token))
154        password_reset_confirm_wrapper(good_reset_req, self.uidb36, self.token)
155        confirm_kwargs = reset_confirm.call_args[1]
156        self.assertEquals(confirm_kwargs['uidb36'], self.uidb36)
157        self.assertEquals(confirm_kwargs['token'], self.token)
158        self.user = User.objects.get(pk=self.user.pk)
159        self.assertTrue(self.user.is_active)
160
161    @patch('student.views.password_reset_confirm')
162    def test_reset_password_with_reused_password(self, reset_confirm):
163        """Tests good token and uidb36 in password reset"""
164
165        good_reset_req = self.request_factory.get('/password_reset_confirm/{0}-{1}/'.format(self.uidb36, self.token))
166        password_reset_confirm_wrapper(good_reset_req, self.uidb36, self.token)
167        confirm_kwargs = reset_confirm.call_args[1]
168        self.assertEquals(confirm_kwargs['uidb36'], self.uidb36)
169        self.assertEquals(confirm_kwargs['token'], self.token)
170        self.user = User.objects.get(pk=self.user.pk)
171        self.assertTrue(self.user.is_active)
172
Full Screen

reset_profile_settings_overlay.js

Source: reset_profile_settings_overlay.js Github

copy
1// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5cr.define('options', function() {
6  var Page = cr.ui.pageManager.Page;
7
8  var AutomaticSettingsResetBanner = options.AutomaticSettingsResetBanner;
9  var ResetProfileSettingsBanner = options.ResetProfileSettingsBanner;
10
11  /**
12   * ResetProfileSettingsOverlay class
13   * Encapsulated handling of the 'Reset Profile Settings' overlay page.
14   * @class
15   */
16  function ResetProfileSettingsOverlay() {
17    Page.call(this, 'resetProfileSettings',
18              loadTimeData.getString('resetProfileSettingsOverlayTabTitle'),
19              'reset-profile-settings-overlay');
20  }
21
22  cr.addSingletonGetter(ResetProfileSettingsOverlay);
23
24  ResetProfileSettingsOverlay.prototype = {
25    // Inherit ResetProfileSettingsOverlay from Page.
26    __proto__: Page.prototype,
27
28    /** @override */
29    initializePage: function() {
30      Page.prototype.initializePage.call(this);
31
32      $('reset-profile-settings-dismiss').onclick = function(e) {
33        ResetProfileSettingsOverlay.dismiss();
34      };
35      $('reset-profile-settings-commit').onclick = function(e) {
36        ResetProfileSettingsOverlay.setResettingState(true);
37        chrome.send('performResetProfileSettings',
38                    [$('send-settings').checked]);
39      };
40      $('expand-feedback').onclick = function(e) {
41        var feedbackTemplate = $('feedback-template');
42        feedbackTemplate.hidden = !feedbackTemplate.hidden;
43        e.preventDefault();
44      };
45    },
46
47    /**
48     * @override
49     * @suppress {checkTypes}
50     * TODO(vitalyp): remove the suppression. See the explanation in
51     * chrome/browser/resources/options/automatic_settings_reset_banner.js.
52     */
53    didShowPage: function() {
54      ResetProfileSettingsBanner.dismiss();
55      chrome.send('onShowResetProfileDialog');
56    },
57
58    /** @override */
59    didClosePage: function() {
60      chrome.send('onHideResetProfileDialog');
61    },
62  };
63
64  /**
65   * Enables/disables UI elements after/while Chrome is performing a reset.
66   * @param {boolean} state If true, UI elements are disabled.
67   */
68  ResetProfileSettingsOverlay.setResettingState = function(state) {
69    $('reset-profile-settings-throbber').style.visibility =
70        state ? 'visible' : 'hidden';
71    $('reset-profile-settings-dismiss').disabled = state;
72    $('reset-profile-settings-commit').disabled = state;
73  };
74
75  /**
76   * Chrome callback to notify ResetProfileSettingsOverlay that the reset
77   * operation has terminated.
78   * @suppress {checkTypes}
79   * TODO(vitalyp): remove the suppression. See the explanation in
80   * chrome/browser/resources/options/automatic_settings_reset_banner.js.
81   */
82  ResetProfileSettingsOverlay.doneResetting = function() {
83    AutomaticSettingsResetBanner.dismiss();
84    ResetProfileSettingsOverlay.dismiss();
85  };
86
87  /**
88   * Dismisses the overlay.
89   */
90  ResetProfileSettingsOverlay.dismiss = function() {
91    PageManager.closeOverlay();
92    ResetProfileSettingsOverlay.setResettingState(false);
93  };
94
95  ResetProfileSettingsOverlay.setFeedbackInfo = function(feedbackListData) {
96    var input = new JsEvalContext(feedbackListData);
97    var output = $('feedback-template');
98    jstProcess(input, output);
99  };
100
101  // Export
102  return {
103    ResetProfileSettingsOverlay: ResetProfileSettingsOverlay
104  };
105});
106
Full Screen

reset.js

Source: reset.js Github

copy
1'use strict';
2
3require('colors');
4var path = require('path');
5var winston = require('winston');
6var async = require('async');
7var fs = require('fs');
8
9var db = require('../database');
10var events = require('../events');
11var meta = require('../meta');
12var plugins = require('../plugins');
13var widgets = require('../widgets');
14
15var dirname = require('./paths').baseDir;
16
17var themeNamePattern = /^(@.*?\/)?nodebb-theme-.*$/;
18var pluginNamePattern = /^(@.*?\/)?nodebb-(theme|plugin|widget|rewards)-.*$/;
19
20exports.reset = function (options, callback) {
21	var map = {
22		theme: function (next) {
23			var themeId = options.theme;
24			if (themeId === true) {
25				resetThemes(next);
26			} else {
27				if (!themeNamePattern.test(themeId)) {
28					// Allow omission of `nodebb-theme-`
29					themeId = 'nodebb-theme-' + themeId;
30				}
31
32				resetTheme(themeId, next);
33			}
34		},
35		plugin: function (next) {
36			var pluginId = options.plugin;
37			if (pluginId === true) {
38				resetPlugins(next);
39			} else {
40				if (!pluginNamePattern.test(pluginId)) {
41					// Allow omission of `nodebb-plugin-`
42					pluginId = 'nodebb-plugin-' + pluginId;
43				}
44
45				resetPlugin(pluginId, next);
46			}
47		},
48		widgets: resetWidgets,
49		settings: resetSettings,
50		all: function (next) {
51			async.series([resetWidgets, resetThemes, resetPlugins, resetSettings], next);
52		},
53	};
54
55	var tasks = Object.keys(map)
56		.filter(function (x) { return options[x]; })
57		.map(function (x) { return map[x]; });
58
59	if (!tasks.length) {
60		console.log([
61			'No arguments passed in, so nothing was reset.\n'.yellow,
62			'Use ./nodebb reset ' + '{-t|-p|-w|-s|-a}'.red,
63			'    -t\tthemes',
64			'    -p\tplugins',
65			'    -w\twidgets',
66			'    -s\tsettings',
67			'    -a\tall of the above',
68			'',
69			'Plugin and theme reset flags (-p & -t) can take a single argument',
70			'    e.g. ./nodebb reset -p nodebb-plugin-mentions, ./nodebb reset -t nodebb-theme-persona',
71			'         Prefix is optional, e.g. ./nodebb reset -p markdown, ./nodebb reset -t persona',
72		].join('\n'));
73
74		process.exit(0);
75	}
76
77	async.series([db.init].concat(tasks), function (err) {
78		if (err) {
79			winston.error('[reset] Errors were encountered during reset', err);
80			throw err;
81		}
82
83		winston.info('[reset] Reset complete');
84		callback();
85	});
86};
87
88function resetSettings(callback) {
89	meta.configs.set('allowLocalLogin', 1, function (err) {
90		winston.info('[reset] Settings reset to default');
91		callback(err);
92	});
93}
94
95function resetTheme(themeId, callback) {
96	fs.access(path.join(dirname, 'node_modules', themeId, 'package.json'), function (err) {
97		if (err) {
98			winston.warn('[reset] Theme `%s` is not installed on this forum', themeId);
99			callback(new Error('theme-not-found'));
100		} else {
101			meta.themes.set({
102				type: 'local',
103				id: themeId,
104			}, function (err) {
105				if (err) {
106					winston.warn('[reset] Failed to reset theme to ' + themeId);
107				} else {
108					winston.info('[reset] Theme reset to ' + themeId);
109				}
110
111				callback();
112			});
113		}
114	});
115}
116
117function resetThemes(callback) {
118	meta.themes.set({
119		type: 'local',
120		id: 'nodebb-theme-persona',
121	}, function (err) {
122		winston.info('[reset] Theme reset to Persona');
123		callback(err);
124	});
125}
126
127function resetPlugin(pluginId, callback) {
128	var active = false;
129
130	async.waterfall([
131		async.apply(db.isSortedSetMember, 'plugins:active', pluginId),
132		function (isMember, next) {
133			active = isMember;
134
135			if (isMember) {
136				db.sortedSetRemove('plugins:active', pluginId, next);
137			} else {
138				next();
139			}
140		},
141		function (next) {
142			events.log({
143				type: 'plugin-deactivate',
144				text: pluginId,
145			}, next);
146		},
147	], function (err) {
148		if (err) {
149			winston.error('[reset] Could not disable plugin: %s encountered error %s', pluginId, err);
150		} else if (active) {
151			winston.info('[reset] Plugin `%s` disabled', pluginId);
152		} else {
153			winston.warn('[reset] Plugin `%s` was not active on this forum', pluginId);
154			winston.info('[reset] No action taken.');
155			err = new Error('plugin-not-active');
156		}
157
158		callback(err);
159	});
160}
161
162function resetPlugins(callback) {
163	db.delete('plugins:active', function (err) {
164		winston.info('[reset] All Plugins De-activated');
165		callback(err);
166	});
167}
168
169function resetWidgets(callback) {
170	async.waterfall([
171		plugins.reload,
172		widgets.reset,
173		function (next) {
174			winston.info('[reset] All Widgets moved to Draft Zone');
175			next();
176		},
177	], callback);
178}
179
Full Screen

oobe_screen_reset.js

Source: oobe_screen_reset.js Github

copy
1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5/**
6 * @fileoverview Device reset screen implementation.
7 */
8
9login.createScreen('ResetScreen', 'reset', function() {
10  var USER_ACTION_CANCEL_RESET = 'cancel-reset';
11  var USER_ACTION_RESTART_PRESSED = 'restart-pressed';
12  var USER_ACTION_LEARN_MORE_PRESSED = 'learn-more-link';
13  var USER_ACTION_SHOW_CONFIRMATION = 'show-confirmation';
14  var USER_ACTION_POWERWASH_PRESSED = 'powerwash-pressed';
15  var USER_ACTION_RESET_CONFIRM_DISMISSED = 'reset-confirm-dismissed';
16  var CONTEXT_KEY_ROLLBACK_AVAILABLE = 'rollback-available';
17  var CONTEXT_KEY_ROLLBACK_CHECKED = 'rollback-checked';
18  var CONTEXT_KEY_IS_OFFICIAL_BUILD = 'is-official-build';
19  var CONTEXT_KEY_IS_CONFIRMATIONAL_VIEW = 'is-confirmational-view';
20  var CONTEXT_KEY_SCREEN_STATE = 'screen-state';
21
22  return {
23
24    /* Possible UI states of the reset screen. */
25    RESET_SCREEN_UI_STATE: {
26      REVERT_PROMISE: 'ui-state-revert-promise',
27      RESTART_REQUIRED: 'ui-state-restart-required',
28      POWERWASH_PROPOSAL: 'ui-state-powerwash-proposal',
29      ROLLBACK_PROPOSAL: 'ui-state-rollback-proposal',
30      ERROR: 'ui-state-error',
31    },
32
33    RESET_SCREEN_STATE: {
34      RESTART_REQUIRED: 0,
35      REVERT_PROMISE: 1,
36      POWERWASH_PROPOSAL: 2,  // supports 2 ui-states
37      ERROR: 3,
38    },
39
40
41    /** @override */
42    decorate: function() {
43      var self = this;
44
45      this.declareUserAction($('powerwash-help-link'),
46                             { action_id: USER_ACTION_LEARN_MORE_PRESSED,
47                               event: 'click'
48                             });
49      this.declareUserAction($('reset-confirm-dismiss'),
50                             { action_id: USER_ACTION_RESET_CONFIRM_DISMISSED,
51                               event: 'click'
52                             });
53      this.declareUserAction($('reset-confirm-commit'),
54                             { action_id: USER_ACTION_POWERWASH_PRESSED,
55                               event: 'click'
56                             });
57
58      this.context.addObserver(
59          CONTEXT_KEY_SCREEN_STATE,
60          function(state) {
61            if (state == self.RESET_SCREEN_STATE.RESTART_REQUIRED)
62              self.ui_state = self.RESET_SCREEN_UI_STATE.RESTART_REQUIRED;
63            if (state == self.RESET_SCREEN_STATE.REVERT_PROMISE)
64              self.ui_state = self.RESET_SCREEN_UI_STATE.REVERT_PROMISE;
65            else if (state == self.RESET_SCREEN_STATE.POWERWASH_PROPOSAL)
66              self.ui_state = self.RESET_SCREEN_UI_STATE.POWERWASH_PROPOSAL;
67            self.setDialogView_();
68            if (state == self.RESET_SCREEN_STATE.REVERT_PROMISE) {
69              announceAccessibleMessage(
70                loadTimeData.getString('resetRevertSpinnerMessage'));
71            }
72          }
73      );
74
75      this.context.addObserver(
76          CONTEXT_KEY_IS_OFFICIAL_BUILD,
77          function(isOfficial) {
78            $('powerwash-help-link').setAttribute('hidden', !isOfficial);
79          }
80      );
81      this.context.addObserver(
82          CONTEXT_KEY_ROLLBACK_CHECKED,
83          function(rollbackChecked) {
84            self.setRollbackOptionView();
85          }
86      );
87      this.context.addObserver(
88          CONTEXT_KEY_ROLLBACK_AVAILABLE,
89          function(rollbackAvailable) {
90            self.setRollbackOptionView();
91          }
92      );
93      this.context.addObserver(
94          CONTEXT_KEY_IS_CONFIRMATIONAL_VIEW,
95          function(is_confirmational) {
96            if (is_confirmational) {
97              console.log(self.context.get(CONTEXT_KEY_SCREEN_STATE, 0));
98              if (self.context.get(CONTEXT_KEY_SCREEN_STATE, 0) !=
99                  self.RESET_SCREEN_STATE.POWERWASH_PROPOSAL)
100              return;
101              console.log(self);
102              reset.ConfirmResetOverlay.getInstance().initializePage();
103            } else {
104              $('overlay-reset').setAttribute('hidden', true);
105            }
106          }
107      );
108    },
109
110    /**
111     * Header text of the screen.
112     * @type {string}
113     */
114    get header() {
115      return loadTimeData.getString('resetScreenTitle');
116    },
117
118    /**
119     * Buttons in oobe wizard's button strip.
120     * @type {array} Array of Buttons.
121     */
122    get buttons() {
123      var buttons = [];
124      var restartButton = this.ownerDocument.createElement('button');
125      restartButton.id = 'reset-restart-button';
126      restartButton.textContent = loadTimeData.getString('resetButtonRestart');
127      this.declareUserAction(restartButton,
128                             { action_id: USER_ACTION_RESTART_PRESSED,
129                               event: 'click'
130                             });
131      buttons.push(restartButton);
132
133      // Button that leads to confirmation pop-up dialog.
134      var toConfirmButton = this.ownerDocument.createElement('button');
135      toConfirmButton.id = 'reset-toconfirm-button';
136      toConfirmButton.textContent =
137          loadTimeData.getString('resetButtonPowerwash');
138      this.declareUserAction(toConfirmButton,
139                             { action_id: USER_ACTION_SHOW_CONFIRMATION,
140                               event: 'click'
141                             });
142      buttons.push(toConfirmButton);
143
144      var cancelButton = this.ownerDocument.createElement('button');
145      cancelButton.id = 'reset-cancel-button';
146      cancelButton.textContent = loadTimeData.getString('cancelButton');
147      this.declareUserAction(cancelButton,
148                             { action_id: USER_ACTION_CANCEL_RESET,
149                               event: 'click'
150                             });
151      buttons.push(cancelButton);
152
153      return buttons;
154    },
155
156    /**
157     * Returns a control which should receive an initial focus.
158     */
159    get defaultControl() {
160      // choose
161      if (this.context.get(CONTEXT_KEY_SCREEN_STATE,
162                           this.RESET_SCREEN_STATE.RESTART_REQUIRED) ==
163          this.RESET_SCREEN_STATE.RESTART_REQUIRED)
164        return $('reset-restart-button');
165      if (this.context.get(CONTEXT_KEY_IS_CONFIRMATIONAL_VIEW, false))
166        return $('reset-confirm-commit');
167      return $('reset-toconfirm-button');
168    },
169
170    /**
171     * Cancels the reset and drops the user back to the login screen.
172     */
173    cancel: function() {
174      if (this.context.get(CONTEXT_KEY_IS_CONFIRMATIONAL_VIEW, false)) {
175        $('reset').send(login.Screen.CALLBACK_USER_ACTED,
176                        USER_ACTION_RESET_CONFIRM_DISMISSED);
177        return;
178      }
179      this.send(login.Screen.CALLBACK_USER_ACTED, USER_ACTION_CANCEL_RESET);
180    },
181
182    /**
183     * Event handler that is invoked just before the screen in shown.
184     * @param {Object} data Screen init payload.
185     */
186    onBeforeShow: function(data) {
187    },
188
189    /**
190      * Sets css style for corresponding state of the screen.
191      * @private
192      */
193    setDialogView_: function(state) {
194      state = this.ui_state;
195      var resetOverlay = $('reset-confirm-overlay');
196      this.classList.toggle(
197          'revert-promise-view',
198          state == this.RESET_SCREEN_UI_STATE.REVERT_PROMISE);
199      this.classList.toggle(
200          'restart-required-view',
201          state == this.RESET_SCREEN_UI_STATE.RESTART_REQUIRED);
202      this.classList.toggle(
203          'powerwash-proposal-view',
204          state == this.RESET_SCREEN_UI_STATE.POWERWASH_PROPOSAL);
205      resetOverlay.classList.toggle(
206          'powerwash-proposal-view',
207          state == this.RESET_SCREEN_UI_STATE.POWERWASH_PROPOSAL);
208      this.classList.toggle(
209          'rollback-proposal-view',
210          state == this.RESET_SCREEN_UI_STATE.ROLLBACK_PROPOSAL);
211      resetOverlay.classList.toggle(
212          'rollback-proposal-view',
213          state == this.RESET_SCREEN_UI_STATE.ROLLBACK_PROPOSAL);
214    },
215
216    setRollbackOptionView: function() {
217      if (this.context.get(CONTEXT_KEY_IS_CONFIRMATIONAL_VIEW, false))
218        return;
219      if (this.context.get(CONTEXT_KEY_SCREEN_STATE) !=
220          this.RESET_SCREEN_STATE.POWERWASH_PROPOSAL)
221        return;
222
223      if (this.context.get(CONTEXT_KEY_ROLLBACK_AVAILABLE, false) &&
224          this.context.get(CONTEXT_KEY_ROLLBACK_CHECKED, false)) {
225        // show rollback option
226        $('reset-toconfirm-button').textContent = loadTimeData.getString(
227            'resetButtonPowerwashAndRollback');
228        this.ui_state = this.RESET_SCREEN_UI_STATE.ROLLBACK_PROPOSAL;
229      } else {
230        // hide rollback option
231        $('reset-toconfirm-button').textContent = loadTimeData.getString(
232            'resetButtonPowerwash');
233        this.ui_state = this.RESET_SCREEN_UI_STATE.POWERWASH_PROPOSAL;
234      }
235      this.setDialogView_();
236    }
237  };
238});
239
Full Screen

urls.py

Source: urls.py Github

copy
1from django.conf.urls import url
2from django.contrib.auth import views as auth_views
3
4
5urlpatterns  = [
6        url(r'^password/change/$', 
7                auth_views.PasswordChangeView.as_view(), 
8                name='password_change'),
9        url(r'^password/change/done/$',
10                auth_views.PasswordChangeDoneView.as_view(), 
11                name='password_change_done'),
12        # url(r'^password-reset/$', views.PasswordResetView.as_view(),
13        # name='password-reset'),
14        url(r'^password/reset/$', 
15                auth_views.PasswordResetView.as_view(template_name = "registeration/password_reset_form.html", email_template_name = 'registeration/password_reset_email.html'), 
16                name='password_reset'),
17        url(r'^password/reset/done/$', 
18                auth_views.PasswordResetDoneView.as_view(template_name = "registeration/password_reset_done.html"), 
19                name='password_reset_done'),
20        url(r'^password/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 
21                auth_views.PasswordResetConfirmView.as_view(template_name = "registeration/password_reset_confirm.html"), 
22                name='password_reset_confirm'),
23        url(r'^password/reset/complete/$', 
24                auth_views.PasswordResetCompleteView.as_view(template_name = "registeration/password_reset_complete.html"), 
25                name='password_reset_complete'),
26]
27
28    #         auth_views.PasswordChangeDoneView.as_view(), 
29    #         name='password_change_done'),
30    # url(r'^password/reset/$', 
31    #         auth_views.PasswordResetView.as_view(template_name = "registeration/password_reset_form.html"), 
32    #         name='password_reset'),
33    # url(r'^password/reset/done/$', 
34    #         auth_views.PasswordResetDoneView.as_view(template_name = "registeration/password_reset_done.html"), 
35    #         name='password_reset_done'),
36    # url(r'^password/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 
37    #         auth_views.PasswordResetConfirmView.as_view(template_name = "registeration/password_reset_confirm.html"), 
38    #         name='password_reset_confirm'),
39    # url(r'^password/reset/complete/$', 
40    #         auth_views.PasswordResetCompleteView.as_view(template_name = "registeration/password_reset_complete.html"), 
41    #         name='password_reset_complete'),
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Run JavaScript Tests on LambdaTest Cloud Grid

Execute automation tests with Playwright Internal on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free
LambdaTestX

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie
Sarah

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)