Fixes unit test

This commit is contained in:
Mouse Reeve 2022-11-23 22:00:34 -08:00
parent cc3cd5c98c
commit dd83e32f32

View file

@ -11,6 +11,7 @@ from bookwyrm import emailing, models
class Emailing(TestCase):
"""every response to a get request, html or json"""
# pylint: disable=invalid-name
def setUp(self):
"""we need basic test data and mocks"""
self.factory = RequestFactory()
@ -41,10 +42,12 @@ class Emailing(TestCase):
self.assertEqual(args[1], "You're invited to join BookWyrm!")
self.assertEqual(len(args), 4)
def test_password_reset_email(self, email_mock):
def test_password_reset_email(self, _):
"""load the password reset email"""
reset = models.PasswordReset.objects.create(user=self.local_user)
emailing.password_reset_email(reset)
with patch("bookwyrm.emailing.send_email") as email_mock:
emailing.password_reset_email(reset)
self.assertEqual(email_mock.call_count, 1)
args = email_mock.call_args[0]