Opened 13 years ago

Closed 13 years ago

#16643 closed New feature (wontfix)

Test Email Backend (locmem) accepts email with blank recipients

Reported by: joelhaasnoot@… Owned by: nobody
Component: Testing framework Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The email backend used in the testing frameworks accepts all messages and does no checking about the content of the email. Most importantly, if the recipient is blank, the email is accepted anyway, while most if not all mail servers will reject those emails. Several other checks might be useful too, but could be split up into a seperate (testing) backend.

Change History (3)

comment:1 by Aymeric Augustin, 13 years ago

Easy pickings: unset
Triage Stage: UnreviewedDesign decision needed
Type: BugNew feature

This idea is a bit vague, and it looks more like a feature request than a bug.

As is, I'm not convinced it's useful, and I don't know how we can get a consensus on a list of useful checks. A patch could help kickstart a discussion.

comment:2 by Mark Lavin, 13 years ago

I don't think email message validation is appropriate in the locmem backend. Your application should not be relying the STMP server throwing errors to validate recipients and your testcase shouldn't either. If you want to validate the recipients in your testcase you can pull them off the message and assert that they are correct. If you need the email backend to raise an exception for a testcase it's simple to patch/mock that behavior with available mocking libraries.

comment:3 by Jacob, 13 years ago

Resolution: wontfix
Status: newclosed

I agree 100% with what mlavin writes above. Thus, I'm marking this ticket wontfix.

joelhaasnoot: if there's an actual real-world bug you're running into, please feel free to reopen this ticket with more information. If there's something actually broken with Django's testing framework we'll fix it, but emulating an SMTP server isn't exactly within scope.

Thanks!

Note: See TracTickets for help on using tickets.
Back to Top