Re: [Django] #11400: Add fail_silently parameter to User.email_user

2013-08-13 Thread Django
#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):

 I have a PR ready for your review and testing:
 https://github.com/django/django/pull/1469

 Feedback is welcome, as always. I've commented out the email_user function
 in `django.contrib.auth` models.py and ran the new test, which failed.
 Then,  I un-commented out the email_user function and the tests passed,
 both unit test and full test suite.

-- 
Ticket URL: 
Django 
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.24252ec1fbacf04e24b5924b5c1c87f6%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11400: Add fail_silently parameter to User.email_user

2013-08-13 Thread Django
#11400: Add fail_silently parameter to User.email_user
-+-
 Reporter:  Jug_ |Owner:  susan
 Type:  New feature  |   Status:  assigned
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:  0|UI/UX:  0
Easy pickings:  1|
-+-
Changes (by susan):

 * cc: susan.tan.fleckerl@… (added)
 * owner:  nobody => susan
 * status:  new => assigned
 * needs_tests:  1 => 0


-- 
Ticket URL: 
Django 
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.8ee44f0463e50d4a4160a86da3e248fd%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11400: Add fail_silently parameter to User.email_user

2013-08-11 Thread Django
#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 timo):

 `runtests.py django.contrib.auth` should work to run the test.

 Regarding the test itself, I would format the dictionary a bit differently
 (space after colon, each key/value pair on a separate line).

 {{{
 kwargs = {
 "fail_silently": False,
 ...
 }
 }}}

 Also, I don't think this test class requires the `@skipIfCustomUser`
 decorator. You'll need to instantiate an `AbstractUser` rather than
 calling `send_email` directly as it isn't a `classmethod`.

-- 
Ticket URL: 
Django 
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.0b9d87b4f32f4c9e7fb34b05315fa679%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11400: Add fail_silently parameter to User.email_user

2013-08-10 Thread Django
#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, Thanks for the reference. I've written the test. I'm used to
 running tests on the django/tests directory. But in this case, the test is
 in `django/contrib/auth/tests/test_models.py`. How do I test this file?
 The auth/tests direcotry does not have a runtests.py.

 I've referred to this doc for running tests:
 https://docs.djangoproject.com/en/1.5/intro/contributing/#running-your-
 new-test

 Below is the new test:
 {{{
 @skipIfCustomUser
 class AbstractUserTestCase(TestCase):
 def test_send_email(self):
 keyword_args = {"fail_silently":False, "auth_user":None,
 "auth_password":None,
   "connection":None, "html_message":None}
 AbstractUser.send_email(subject="Subject here",
 message="This is a message", from_email="f...@domain.com",
 recipient_list="t...@domain.com", **keyword_args)

 # Test that one message has been sent.
 self.assertEqual(self.assertEqual(len(mail.outbox), 1))

 # Verify that the subject of the first message is correct.
 self.assertEqual(mail.outbox[0].subject, 'Subject here')
 }}}

-- 
Ticket URL: 
Django 
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.6118288fa9e12948dd957049d1a7175b%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11400: Add fail_silently parameter to User.email_user

2013-08-10 Thread Django
#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 timo):

 `email_user()` is a method on `AbstractUser` not `UserManager`, otherwise
 the test looks like a reasonable start.

 You can read about testing email here:
 https://docs.djangoproject.com/en/dev/topics/testing/overview/#email-
 services

-- 
Ticket URL: 
Django 
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.ef9109ef68d779d71f4c378e36f04405%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11400: Add fail_silently parameter to User.email_user

2013-08-10 Thread Django
#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, "")
 }}}

 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: 
Django 
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.




Re: [Django] #11400: Add fail_silently parameter to User.email_user

2013-08-01 Thread Django
#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|
-+-
Changes (by timo):

 * needs_docs:  0 => 1
 * easy:  0 => 1


Comment:

 The patch needs to be updated to apply cleanly. It also needs tests
 (doesn't look like `email_user` is tested at all) - probably in
 `django/contrib/auth/tests/test_models.py`. The doc in the current patch
 (`docs/topics/auth.txt`) has moved to `docs/ref/contrib/auth.txt`) and a
 mention in the release notes is also needed.

-- 
Ticket URL: 
Django 
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.848746022eccae41517994a3b6e2b094%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11400: Add fail_silently parameter to User.email_user

2012-08-01 Thread Django
#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:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  1|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by vanschelven):

 Just weighing in on a ticket that seems to be living in limbo for three
 years at this point:

 This should either be 'design decision needed', or be quickly resolved,
 since it seems rather trivial to me. What's needed to move this forward?

 Personally, I don't think passing ```**kwargs``` around is the pinnacle of
 elegance. Are there more ```kwargs``` that we're interested in, or is it
 really just ```fail_silently```?

 As a final thought, if we consider this a desirable feature, maybe
 fail_silently should be customizable in more cases. Specifically, it's not
 easy to customize the ```password_reset``` view to have a different value
 for fail_silently without subclassing and completely copy/pasting
 ```PasswordResetForm```. Maybe that's a separate ticket?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #11400: Add fail_silently parameter to User.email_user

2011-04-16 Thread Django
#11400: Add fail_silently parameter to User.email_user
-+-
   Reporter:  Jug_   |Owner:  nobody
   Type:  New|   Status:  new
  feature|Component:  contrib.auth
  Milestone: | Severity:  Normal
Version:  SVN| Keywords:  email user
 Resolution: |  fail_silently
   Triage Stage:  Accepted   |Has patch:  1
Needs documentation:  0  |  Needs tests:  1
Patch needs improvement:  0  |
-+-
Changes (by julien):

 * needs_tests:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11400: Add fail_silently parameter to User.email_user

2009-12-06 Thread Django
#11400: Add fail_silently parameter to User.email_user
---+
  Reporter:  Jug_  | Owner:  nobody  
Status:  new   | Milestone:  
 Component:  Contrib apps  |   Version:  SVN 
Resolution:|  Keywords:  email user fail_silently
 Stage:  Accepted  | Has_patch:  1   
Needs_docs:  0 |   Needs_tests:  0   
Needs_better_patch:  0 |  
---+
Changes (by john_scott):

  * has_patch:  0 => 1

Comment:

 Added patch so `email_user()` passes **kwargs to `send_mail`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.