1 Blog Entry tagged: testing


Testing Emails with Django

  • November 20th, 2008 (1 year, 3 months ago)

Django ticket #8638 titled, "Provide setting to disable e-mail sending", caught my eye as an interesting item to look into. As I looked into it, however, I came up with a pretty simple way to set up testing that involves some settings.py changes and about 4 lines of Python code.

The big piece of magic comes from Python's built-in smtpd library and the smtpd.DebuggingServer class, which discards all e-mails sent to it and prints them to stdout.

Let's use the class to create a local mail server that will discard and print all emails sent to ...

Read the rest »

About this entry

Date Posted:
November 20th 2008 at 9:11:42 PM

Tagged:
debug, django, email, testing