Skip to content
Advertisement

Django Test framework with file based Email backend server

I have formulated test cases in Django framework.

Use Case: I am using API that register user by sending them an Email and when they click on the link provided in the Email their account get activated.

In my settings.py I am using

JavaScript

which points to the local directory.

When running PyUnit test case from eclipse everything works file. Text file gets generated for each email sent

But, When i am using

JavaScript

the files does not generate.

Any insight what is the difference when I execute test case with ./manage.py and when I use pyUnit ?

Advertisement

Answer

The simple answer:

You can’t do this without engineering your own email system, but that would probably be silly. I would suggest doing something else to verify that the code was successful without requiring the email to be sent. Like, run the code, assume the user clicks the link and create RequestFactory to get/post the link to run the view code associated with it.

From the Django Testing Application:

Email services

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement