Opened 5 months ago

#34300 new defect

Ensure GetTor's email unit tests are properly formatted

Reported by: cohosh Owned by:
Priority: Medium Milestone:
Component: Applications/GetTor Version:
Severity: Normal Keywords:
Cc: traumschule, hiro, gaba, phw, cohosh Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


From #34286:


Looks good to me!

On a slightly related note: I believe that an email's body is supposed to be separated by two (rather than one) newlines from its header. GetTor's unit tests are using only one (and mix \n with \r\n). Python's email module is also confused by this and thinks that the body is part of the To field:

In [1]: from email import message_from_string
In [3]: m=message_from_string("From:\nSubject: Undelivered Mail Returned to Sender\r\nTo:\n osx en\n")
In [6]: m.items()
[('From', ''),
 ('Subject', 'Undelivered Mail Returned to Sender'),
 ('To', '\n osx en')]

This seems like something we should fix.

Child Tickets

Change History (0)

Note: See TracTickets for help on using tickets.