Cannot run Django tests in Debugger

I am using Virtualenv/Django/jenkins/nose and can successfully run the project and the debugger - all of that works fine.

Nevertheless, I am trying to run the test cases and even debug them - but the settings file fails to import.

In the command line

python manage.py test

works fine.

I have tried adding paths to the environment variables, adding DJANGO_SETTINGS, etc, nothing works.

This is the error stack I get:

/Users/rburhum/.virtualenvs/amigoserver/bin/python /Applications/PyCharm.app/helpers/pycharm/django_test_manage.py test test /Users/rburhum/src/amigoserver/django/amigoserver
Testing started at 7:39 PM ...
Traceback (most recent call last):
  File "/Applications/PyCharm.app/helpers/pycharm/django_test_manage.py", line 25, in <module>
    from django.core.management.commands.test import Command
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/core/management/commands/test.py", line 7, in <module>
    from django.test.utils import get_runner
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/test/__init__.py", line 5, in <module>
    from django.test.client import Client, RequestFactory
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/test/client.py", line 21, in <module>
    from django.test import signals
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/test/signals.py", line 2, in <module>
    from django.db import connections
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/db/__init__.py", line 11, in <module>
    if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
    self._setup()
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/Users/rburhum/.virtualenvs/amigoserver/lib/python2.7/site-packages/django/conf/__init__.py", line 95, in __init__
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'amigoserver.amigoserver.settings' (Is it on sys.path?): No module named amigoserver.settings

Process finished with exit code 1

I am attaching an image of my test settings. Any place I should be looking at to find out why this works on the command line and not on PyCharm?

Thanks for your help


Screen Shot 2013-01-09 at 7.39.26 PM.png

Please sign in to leave a comment.