Updates tests

This commit is contained in:
Mouse Reeve 2022-07-15 11:18:47 -07:00
parent b62f8eff42
commit 1bb0a9d998

View file

@ -54,6 +54,7 @@ class ChangePasswordViews(TestCase):
with patch("bookwyrm.views.preferences.change_password.login"):
result = view(request)
validate_html(result.render())
self.local_user.refresh_from_db()
self.assertNotEqual(self.local_user.password, password_hash)
def test_password_change_wrong_current(self):
@ -71,6 +72,7 @@ class ChangePasswordViews(TestCase):
request.user = self.local_user
result = view(request)
validate_html(result.render())
self.local_user.refresh_from_db()
self.assertEqual(self.local_user.password, password_hash)
def test_password_change_mismatch(self):
@ -88,6 +90,7 @@ class ChangePasswordViews(TestCase):
request.user = self.local_user
result = view(request)
validate_html(result.render())
self.local_user.refresh_from_db()
self.assertEqual(self.local_user.password, password_hash)
def test_password_change_invalid(self):
@ -105,4 +108,5 @@ class ChangePasswordViews(TestCase):
request.user = self.local_user
result = view(request)
validate_html(result.render())
self.local_user.refresh_from_db()
self.assertEqual(self.local_user.password, password_hash)