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.3KB

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