You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

settings.py 3.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import os
  2. import oscar
  3. from oscar.defaults import * # noqa
  4. # Path helper
  5. location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
  6. DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', }, }
  7. INSTALLED_APPS = [
  8. 'django.contrib.auth',
  9. 'django.contrib.admin',
  10. 'django.contrib.contenttypes',
  11. 'django.contrib.sessions',
  12. 'django.contrib.sites',
  13. 'django.contrib.flatpages',
  14. 'django.contrib.staticfiles',
  15. 'compressor',
  16. 'widget_tweaks',
  17. # contains models we need for testing
  18. 'tests._site.model_tests_app',
  19. 'tests._site.myauth',
  20. # Use a custom partner app to test overriding models. I can't
  21. # find a way of doing this on a per-test basis, so I'm using a
  22. # global change.
  23. ] + oscar.get_core_apps(['tests._site.apps.partner', 'tests._site.apps.customer'])
  24. AUTH_USER_MODEL = 'myauth.User'
  25. TEMPLATE_CONTEXT_PROCESSORS = (
  26. "django.contrib.auth.context_processors.auth",
  27. "django.core.context_processors.request",
  28. "django.core.context_processors.debug",
  29. "django.core.context_processors.i18n",
  30. "django.core.context_processors.media",
  31. "django.core.context_processors.static",
  32. "django.contrib.messages.context_processors.messages",
  33. 'oscar.apps.search.context_processors.search_form',
  34. 'oscar.apps.customer.notifications.context_processors.notifications',
  35. 'oscar.apps.promotions.context_processors.promotions',
  36. 'oscar.apps.checkout.context_processors.checkout',
  37. 'oscar.core.context_processors.metadata',
  38. )
  39. TEMPLATE_DIRS = (
  40. location('_site/templates'),
  41. oscar.OSCAR_MAIN_TEMPLATE_DIR,
  42. )
  43. TEMPLATE_LOADERS = (
  44. ('django.template.loaders.cached.Loader',
  45. ['django.template.loaders.filesystem.Loader',
  46. 'django.template.loaders.app_directories.Loader',
  47. 'django.template.loaders.eggs.Loader']),
  48. )
  49. MIDDLEWARE_CLASSES = (
  50. 'django.middleware.common.CommonMiddleware',
  51. 'django.contrib.sessions.middleware.SessionMiddleware',
  52. 'django.middleware.csrf.CsrfViewMiddleware',
  53. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  54. 'django.contrib.messages.middleware.MessageMiddleware',
  55. 'oscar.apps.basket.middleware.BasketMiddleware',
  56. )
  57. AUTHENTICATION_BACKENDS = (
  58. 'oscar.apps.customer.auth_backends.EmailBackend',
  59. 'django.contrib.auth.backends.ModelBackend',
  60. )
  61. HAYSTACK_CONNECTIONS = {'default': {'ENGINE': 'haystack.backends.simple_backend.SimpleEngine'}}
  62. PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher']
  63. ROOT_URLCONF = 'tests._site.urls'
  64. LOGIN_REDIRECT_URL = '/accounts/'
  65. STATIC_URL = '/static/'
  66. COMPRESS_ENABLED = False
  67. COMPRESS_ROOT = '' # needed to avoid issue #1214
  68. DEBUG = False
  69. SITE_ID = 1
  70. USE_TZ = 1
  71. APPEND_SLASH = True
  72. DDF_DEFAULT_DATA_FIXTURE = 'tests.dynamic_fixtures.OscarDynamicDataFixtureClass'
  73. SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
  74. # temporary workaround for issue in sorl-thumbnail in Python 3
  75. # https://github.com/mariocesar/sorl-thumbnail/pull/254
  76. THUMBNAIL_DEBUG = False,
  77. OSCAR_INITIAL_ORDER_STATUS = 'A'
  78. OSCAR_ORDER_STATUS_PIPELINE = {'A': ('B',), 'B': ()}
  79. OSCAR_INITIAL_LINE_STATUS = 'a'
  80. OSCAR_LINE_STATUS_PIPELINE = {'a': ('b', ), 'b': ()}
  81. SECRET_KEY = 'notverysecret'
  82. TEST_RUNNER = 'django.test.runner.DiscoverRunner'