#11400: Add fail_silently parameter to User.email_user
-------------------------------------+-------------------------------------
     Reporter:  Jug_                 |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  contrib.auth         |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  email user           |             Triage Stage:  Accepted
  fail_silently                      |      Needs documentation:  1
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  1                    |                    UI/UX:  0
Easy pickings:  1                    |
-------------------------------------+-------------------------------------

Comment (by susan):

 @timo, The only aspect that is the most confusing to me is the unit test.
 How do I test that the email sent to a user was a successful event? I see
 that {{{email_user}}} doesn't return anything from a quick read of the
 code. In principle, I picture that the new test inside
 `UserManagerTestCase(TestCase)` in the `tests/test_models.py` should look
 like this:

 {{{
 def test_send_email(self):
         keyword_args = {"fail_silently":False, "auth_user":None,
 "auth_password":None,
               "connection":None, "html_message":None}
         sucesss_indicator = UserManager.send_email(subject="This is
 subject",
             message="This is a message", from_email="sus...@domain.com",
             recipient_list="sus...@domain.com", **keyword_args)
         self.assertEqual(sucesss_indicator, "<expected output of
 success>")
 }}}

 What do you think? I'm not sure what the success_indicator is, the
 expected output for send_email function.
 Can you point me in the right direction? Are there any other testing
 considerations that I missed?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/11400#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.d2d35db008a621f4bcfecbd3e9cf92a3%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to