title: Django can't find settings file when running unit tests
body: <p>I'm trying to run unit tests on my django application but I'm getting following error. Running application is fine though. I'm using pycharm 3.0.</p>
  
  <pre><code>C:\Users\user\my-project-env\Scripts\python.exe "K:\Program Files (x86)\JetBrains\PyCharm 3.0\helpers\pycharm\utrunner.py" C:/Users/user/PycharmProjects/my-project/my_app/ true
  Testing started at 20:16 ...
  Traceback (most recent call last):
    File "K:\Program Files (x86)\JetBrains\PyCharm 3.0\helpers\pycharm\utrunner.py", line 113, in &lt;module&gt;
      modules = loadModulesFromFolderRec(a[0])
    File "K:\Program Files (x86)\JetBrains\PyCharm 3.0\helpers\pycharm\utrunner.py", line 63, in loadModulesFromFolderRec
      os.path.walk(folder, walkModules, (modules, pattern))
    File "C:\Users\user\my-project-env\lib\ntpath.py", line 259, in walk
      func(arg, top, names)
    File "K:\Program Files (x86)\JetBrains\PyCharm 3.0\helpers\pycharm\utrunner.py", line 51, in walkModules
      modules.append(loadSource(os.path.join(dirname, name)))
    File "K:\Program Files (x86)\JetBrains\PyCharm 3.0\helpers\pycharm\utrunner.py", line 40, in loadSource
      module = imp.load_source(moduleName, fileName)
    File "C:/Users/user/PycharmProjects/my-project/my_app/tests.py", line 8, in &lt;module&gt;
      from django.test import TestCase
    File "C:\Users\user\my-project-env\lib\site-packages\django\test\__init__.py", line 5, in &lt;module&gt;
      from django.test.client import Client, RequestFactory
    File "C:\Users\user\my-project-env\lib\site-packages\django\test\client.py", line 21, in &lt;module&gt;
      from django.db import close_connection
    File "C:\Users\user\my-project-env\lib\site-packages\django\db\__init__.py", line 11, in &lt;module&gt;
      if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
    File "C:\Users\user\my-project-env\lib\site-packages\django\conf\__init__.py", line 53, in __getattr__
      self._setup(name)
    File "C:\Users\user\my-project-env\lib\site-packages\django\conf\__init__.py", line 46, in _setup
      % (desc, ENVIRONMENT_VARIABLE))
  django.core.exceptions.ImproperlyConfigured: Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
  
  Process finished with exit code 1
  </code></pre>