Skip to content
This repository
tree: c70785aeed
Fetching contributors…

Cannot retrieve contributors at this time

file 81 lines (76 sloc) 3.195 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
import os

from django.conf import settings, global_settings


if not settings.configured:
    from oscar.defaults import *
    oscar_settings = dict([(k, v) for k, v in locals().items() if k.startswith('OSCAR_')])

    # Helper function to extract absolute path
    location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)

    settings.configure(
            DATABASES={
                'default': {
                    'ENGINE': 'django.db.backends.sqlite3',
                    }
                },
            INSTALLED_APPS=[
                'django.contrib.auth',
                'django.contrib.admin',
                'django.contrib.contenttypes',
                'django.contrib.sessions',
                'django.contrib.sites',
                'django.contrib.flatpages',
                # Oscar apps
                'oscar',
                'oscar.apps.analytics',
                'oscar.apps.discount',
                'oscar.apps.order',
                'oscar.apps.checkout',
                'oscar.apps.shipping',
                'oscar.apps.catalogue',
                'oscar.apps.catalogue.reviews',
                'oscar.apps.basket',
                'oscar.apps.payment',
                'oscar.apps.offer',
                'oscar.apps.address',
                'oscar.apps.partner',
                'oscar.apps.customer',
                'oscar.apps.promotions',
                'oscar.apps.search',
                'oscar.apps.voucher',
                'oscar.apps.dashboard',
                'oscar.apps.dashboard.reports',
                'oscar.apps.dashboard.users',
                'oscar.apps.dashboard.orders',
                'oscar.apps.dashboard.promotions',
                'oscar.apps.dashboard.catalogue',
                ],
            TEMPLATE_CONTEXT_PROCESSORS=(
                "django.contrib.auth.context_processors.auth",
                "django.core.context_processors.request",
                "django.core.context_processors.debug",
                "django.core.context_processors.i18n",
                "django.core.context_processors.media",
                "django.core.context_processors.static",
                "django.contrib.messages.context_processors.messages",
                'oscar.apps.search.context_processors.search_form',
                'oscar.apps.promotions.context_processors.promotions',
                'oscar.apps.checkout.context_processors.checkout',
                ),
            TEMPLATE_DIRS=(
                location('templates'),
                ),
            MIDDLEWARE_CLASSES=global_settings.MIDDLEWARE_CLASSES + (
                'oscar.apps.basket.middleware.BasketMiddleware',
                ),
            AUTHENTICATION_BACKENDS=(
                'oscar.apps.customer.auth_backends.Emailbackend',
                'django.contrib.auth.backends.ModelBackend',
                ),
            ROOT_URLCONF='tests.urls',
            LOGIN_REDIRECT_URL='/accounts/',
            DEBUG=False,
            SITE_ID=1,
            HAYSTACK_SEARCH_ENGINE='dummy',
            HAYSTACK_SITECONF = 'oscar.search_sites',
            APPEND_SLASH=True,
            **oscar_settings
        )
Something went wrong with that request. Please try again.