@@ -78,7 +78,6 @@ def test_logout_view_logs_user_out(auth_client):
7878 response = auth_client .post (reverse ("logout" ))
7979 assert response .status_code in (302 , 301 )
8080
81- # The logout view should end the session, so following requests must be anonymous
8281 follow_up = auth_client .get (reverse ("home" ))
8382 assert follow_up .wsgi_request .user .is_anonymous
8483
@@ -130,7 +129,8 @@ def test_user_can_update_self(auth_client, users):
130129@pytest .mark .django_db
131130def test_user_can_update_password (auth_client , users ):
132131 url = reverse ("users:update" , args = [users ["alice" ].pk ])
133- new_password = "Newpass456"
132+ new_password = "Secur3Pass!234"
133+
134134 response = auth_client .post (
135135 url ,
136136 data = {
@@ -154,14 +154,14 @@ def test_user_can_update_password(auth_client, users):
154154@pytest .mark .django_db
155155def test_user_update_requires_both_password_fields (auth_client , users ):
156156 url = reverse ("users:update" , args = [users ["alice" ].pk ])
157- password_one = "SinglePass789"
157+
158158 response = auth_client .post (
159159 url ,
160160 data = {
161161 "username" : "alice" ,
162162 "first_name" : "Alice" ,
163163 "last_name" : "A" ,
164- "password1" : password_one ,
164+ "password1" : "OnlyOnce123!" ,
165165 "password2" : "" ,
166166 },
167167 )
@@ -174,16 +174,15 @@ def test_user_update_requires_both_password_fields(auth_client, users):
174174@pytest .mark .django_db
175175def test_user_update_password_mismatch (auth_client , users ):
176176 url = reverse ("users:update" , args = [users ["alice" ].pk ])
177- first_password = "Mismatch111"
178- second_password = "Mismatch222"
177+
179178 response = auth_client .post (
180179 url ,
181180 data = {
182181 "username" : "alice" ,
183182 "first_name" : "Alice" ,
184183 "last_name" : "A" ,
185- "password1" : first_password ,
186- "password2" : second_password ,
184+ "password1" : "Mismatch123!" ,
185+ "password2" : "Mismatch321!" ,
187186 },
188187 )
189188
0 commit comments