def test_send_mail_call(self, mock_send): send_policy_document_update_notification(self.user.id, 'both') args, kwargs = mock_send.call_args self.assertEqual(args[2], settings.DEFAULT_FROM_EMAIL) self.assertEqual(args[3][0], self.user.email) self.assertEqual(len(args[3]), 1) self.assertFalse(kwargs.get("fail_silently"))
def test_docs_bad_value(self): with self.assertRaises(ValueError): send_policy_document_update_notification(self.user.id, 'foobar')
def test_docs_good_values(self, docs): send_policy_document_update_notification(self.user.id, docs)