diff --git a/django/contrib/auth/tests/views.py b/django/contrib/auth/tests/views.py
index b03489c..be1d89c 100644
a
|
b
|
class ChangePasswordTest(AuthViewsTestCase):
|
193 | 193 | self.fail_login() |
194 | 194 | self.login(password='password1') |
195 | 195 | |
| 196 | def test_password_change_done_succeeds(self): |
| 197 | self.login() |
| 198 | response = self.client.post('/password_change/', { |
| 199 | 'old_password': 'password', |
| 200 | 'new_password1': 'password1', |
| 201 | 'new_password2': 'password1', |
| 202 | } |
| 203 | ) |
| 204 | self.assertEqual(response.status_code, 302) |
| 205 | self.assertTrue(response['Location'].endswith('/password_change/done/')) |
| 206 | |
| 207 | def test_password_change_done_fails(self): |
| 208 | response = self.client.get('/password_change/done/') |
| 209 | self.assertEquL(response.status_code, 302) |
| 210 | self.assertTrue(response['Location'].endswith('/login/')) |
| 211 | |
| 212 | |
196 | 213 | class LoginTest(AuthViewsTestCase): |
197 | 214 | |
198 | 215 | def test_current_site_in_context_after_login(self): |
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
index eba83a2..53fa60b 100644
a
|
b
|
def password_change(request,
|
245 | 245 | return render_to_response(template_name, context, |
246 | 246 | context_instance=RequestContext(request, current_app=current_app)) |
247 | 247 | |
| 248 | @login_required |
248 | 249 | def password_change_done(request, |
249 | 250 | template_name='registration/password_change_done.html', |
250 | 251 | current_app=None, extra_context=None): |