2

As it is failing to import django.test module, unit test does not work.

>>> import django.test
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\django\test\__init__.py", line 5, in <mod
le>
    from django.test.client import Client, RequestFactory
  File "C:\Python27\lib\site-packages\django\test\client.py", line 21, in <modu
e>
    from django.test import signals
ImportError: cannot import name signals
>>>

Please some one help me in resolving it. I am using django version 1.3

DrTyrsa
  • 31,014
  • 7
  • 86
  • 86
  • Can you please provide more info on your install? Did you check that the signals.py file exists in the C:\Python27\lib\site-packages\django\test\ folder? – luc Jul 28 '11 at 08:07
  • Are you running a shell using `python manage.py shell` ? – Thibault J Jul 28 '11 at 08:31
  • Please separate `code` from question. Please **Edit** your question to indent only the `code` and not indent the question. – S.Lott Jul 28 '11 at 10:17

1 Answers1

0

The solution explained here: ImportError: cannot import name signals worked for me.

They added these lines to the test:

from django.core import management;
import myapp.settings as settings;
management.setup_environ(settings)
Community
  • 1
  • 1
Sam
  • 6,437
  • 6
  • 33
  • 41