Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import os
  2. from django.conf import settings, global_settings
  3. from oscar import OSCAR_CORE_APPS, OSCAR_MAIN_TEMPLATE_DIR
  4. def configure(nose_args=None):
  5. if not settings.configured:
  6. from oscar.defaults import OSCAR_SETTINGS
  7. # Helper function to extract absolute path
  8. location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
  9. settings.configure(
  10. DATABASES={
  11. 'default': {
  12. 'ENGINE': 'django.db.backends.sqlite3',
  13. 'NAME': ':memory:',
  14. }
  15. },
  16. INSTALLED_APPS=[
  17. 'django.contrib.auth',
  18. 'django.contrib.admin',
  19. 'django.contrib.contenttypes',
  20. 'django.contrib.sessions',
  21. 'django.contrib.sites',
  22. 'django.contrib.flatpages',
  23. 'sorl.thumbnail',
  24. 'compressor',
  25. ] + OSCAR_CORE_APPS,
  26. TEMPLATE_CONTEXT_PROCESSORS=(
  27. "django.contrib.auth.context_processors.auth",
  28. "django.core.context_processors.request",
  29. "django.core.context_processors.debug",
  30. "django.core.context_processors.i18n",
  31. "django.core.context_processors.media",
  32. "django.core.context_processors.static",
  33. "django.contrib.messages.context_processors.messages",
  34. 'oscar.apps.search.context_processors.search_form',
  35. 'oscar.apps.customer.notifications.context_processors.notifications',
  36. 'oscar.apps.promotions.context_processors.promotions',
  37. 'oscar.apps.checkout.context_processors.checkout',
  38. ),
  39. TEMPLATE_DIRS=(
  40. location('templates'),
  41. OSCAR_MAIN_TEMPLATE_DIR,
  42. ),
  43. MIDDLEWARE_CLASSES=global_settings.MIDDLEWARE_CLASSES + (
  44. 'oscar.apps.basket.middleware.BasketMiddleware',
  45. ),
  46. AUTHENTICATION_BACKENDS=(
  47. 'oscar.apps.customer.auth_backends.Emailbackend',
  48. 'django.contrib.auth.backends.ModelBackend',
  49. ),
  50. HAYSTACK_CONNECTIONS={
  51. 'default': {
  52. 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
  53. }
  54. },
  55. ROOT_URLCONF='tests._site.urls',
  56. LOGIN_REDIRECT_URL='/accounts/',
  57. STATIC_URL='/static/',
  58. COMPRESS_ENABLED=False,
  59. DEBUG=False,
  60. SITE_ID=1,
  61. APPEND_SLASH=True,
  62. NOSE_ARGS=nose_args,
  63. **OSCAR_SETTINGS
  64. )