settings.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. """
  2. Django settings for testing django-nose.
  3. Configuration is overriden by environment variables:
  4. DATABASE_URL - See https://github.com/kennethreitz/dj-database-url
  5. USE_SOUTH - Set to 1 to include South in INSTALLED_APPS
  6. TEST_RUNNER - Dotted path of test runner to use (can also use --test-runner)
  7. NOSE_PLUGINS - Comma-separated list of plugins to add
  8. """
  9. from __future__ import print_function
  10. from os import environ, path
  11. import dj_database_url
  12. BASE_DIR = path.dirname(path.dirname(__file__))
  13. def rel_path(*subpaths):
  14. """Construct the full path given a relative path."""
  15. return path.join(BASE_DIR, *subpaths)
  16. DATABASES = {
  17. 'default':
  18. dj_database_url.config(
  19. default='sqlite:///' + rel_path('testapp.sqlite3'))
  20. }
  21. MIDDLEWARE_CLASSES = ()
  22. INSTALLED_APPS = [
  23. 'django_nose',
  24. 'testapp',
  25. ]
  26. raw_test_runner = environ.get('TEST_RUNNER')
  27. if raw_test_runner:
  28. TEST_RUNNER = raw_test_runner
  29. else:
  30. TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
  31. raw_plugins = environ.get('NOSE_PLUGINS')
  32. if raw_plugins:
  33. NOSE_PLUGINS = raw_plugins.split(',')
  34. SECRET_KEY = 'ssshhhh'