'This method is a custom assertion that verifies that a password reset
view returns an error response as expected.
Args:
response: response from calling a password reset endpoint
error_message: message we expect to see in the response
valid_link: if the current password reset link is still valid'

def assertPasswordResetError(self, response, error_message, valid_link=False):

    self.assertEqual(response.status_code, 200)
    self.assertEqual(response.context_data['validlink'], valid_link)
    self.assertIn(error_message, response.content)
