Code

Opened 3 years ago

Closed 3 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.

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by aaugustin

  • Easy pickings unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed
  • Type changed from Bug to New 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 Changed 3 years ago by mlavin

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 Changed 3 years ago by jacob

  • Resolution set to wontfix
  • Status changed from new to closed

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!

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.