I upgraded to PyCharm 2.5 and in the meantime updated django-templated-email
to version 0.4.3.
Now Django unit tests no longer work through PyCharm, since I get the error message ImportError: cannot import name send_templated_mail
at the output of the test console.
When you run the same test in the console, this error does not appear. I have a feeling that this is due to the fact that send_templated_email
is part of templated_email\__init__.py
(I vaguely remember a similar problem once, but I can't let my life remember how I fixed it).
Settings in the test dialog box:
Target: <django app name> Custom settings: <path to dev settings> Environment variables: PYTHONPATH: <path as set in virtualenv> Python interpreter: <virtualenv Python interpreter> Interpreter options: None Working directory: <path to Django project (where manage.py resides)>
It is strange that code verification inside the IDE does not complain and loads the templated_email
module correctly through from templated_email import send_templated_mail
.
I am using Windows 7, and my Django application runs inside virtualenv (which is correctly recognized by PyCharm).
source share