#35118: Mention test-suggestions when specific email-backend is used
--------------------------------------+------------------------------------
     Reporter:  jecarr                |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Core (Mail)           |                  Version:  5.0
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  1
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Baptiste Mispelon):

 * needs_better_patch:  0 => 1
 * component:  Documentation => Core (Mail)
 * stage:  Unreviewed => Accepted


Comment:

 Hi and thanks for the report!

 Your proposed addition looks quite good, though I personally would like to
 see a minimal code example, or at least link to Python's documentation for
 mocking since the term might not be familiar to everyone.

 But in general I think your report point to a bigger issue that might
 require more than a documentation fix. The fact that "real" emails can be
 sent during tests if one uses a custom `connection` in their code was
 quite surprising to me.
 When sending emails using the default connection it's easy enough to point
 your test settings to the `locmem` backend to prevent sending actual
 emails. But when using a custom `connection` there's no setting that can
 help. Instead one must remember to do the mocking you're suggesting. That
 seems very error-prone and the penalty for forgetting that can be quite
 high.

 I can't see how to fix that problem easily. Maybe the multiple email
 backend idea floated in ticket:6989#comment:23 could be the way? Do you
 have other ideas?

 I'll mark this ticket as accepted on that basis. I think we should try to
 find a systematic solution to the problem but if that's too hard we should
 at least document quite loudly that one must pay attention when using a
 custom `connection`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/35118#comment:1>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018d1248378d-250015c5-c009-4419-8bb5-53becdec3ddb-000000%40eu-central-1.amazonses.com.

Reply via email to