コード例 #1
0
 def test_uses_non_dashboard_override_when_specified(self):
     apps = izi.get_core_apps(overrides=['apps.shipping'])
     self.assertTrue('apps.shipping' in apps)
     self.assertTrue('izi.apps.shipping' not in apps)
コード例 #2
0
 def test_uses_dashboard_override_when_specified(self):
     apps = izi.get_core_apps(overrides=['apps.dashboard.catalogue'])
     self.assertTrue('apps.dashboard.catalogue' in apps)
     self.assertTrue('izi.apps.dashboard.catalogue' not in apps)
     self.assertTrue('izi.apps.catalogue' in apps)
コード例 #3
0
# Application definition

INSTALLED_APPS = [
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    'django.contrib.staticfiles',
    'django.contrib.flatpages',

    'widget_tweaks',

    'izi_invoices'
] + get_core_apps()

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'izi.apps.basket.middleware.BasketMiddleware',
]

ROOT_URLCONF = 'urls'

TEMPLATES = [
コード例 #4
0
 def test_returns_core_apps_when_no_overrides_specified(self):
     apps = izi.get_core_apps()
     self.assertEqual(izi.IZI_CORE_APPS, apps)
コード例 #5
0
    'django.contrib.flatpages',
    'django.contrib.staticfiles',
    'django.contrib.sitemaps',
    'django_extensions',

    # Debug toolbar + extensions
    'debug_toolbar',
    'apps.gateway',  # For allowing dashboard access
    # 'apps.permissions',
    'guardian',  # For check object permission
    # Requires izi-paypal
    'paypal',  # For testing with shipping and payment
    'izi_shipping',
    'izi_accounts',
    'widget_tweaks',
] + izi.get_core_apps(['apps.shipping', 'apps.checkout'])

# Add IZI's custom auth backend so users can sign in using their email
# address.
AUTHENTICATION_BACKENDS = (
    'izi.apps.customer.auth_backends.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
    'guardian.backends.ObjectPermissionBackend',  # New
    'sandbox.apps.permissions.backend.ObjectPermBackend',
)

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
        'OPTIONS': {
コード例 #6
0
}


INSTALLED_APPS = [
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'django.contrib.staticfiles',

    # External apps
    'widget_tweaks',
] + get_core_apps(['apps.shipping']) + ['izi_accounts']

AUTHENTICATION_BACKENDS = (
    'izi.apps.customer.auth_backends.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

LOGIN_REDIRECT_URL = '/accounts/'
APPEND_SLASH = True


IZI_SHOP_TAGLINE = "Accounts"

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
コード例 #7
0
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.admin',
    'django.contrib.gis',
    'django.contrib.flatpages',
    'django_extensions',
    'debug_toolbar',
    'stores',
    'widget_tweaks',
]


INSTALLED_APPS += izi.get_core_apps()

AUTHENTICATION_BACKENDS = (
    'izi.apps.customer.auth_backends.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

LOGIN_REDIRECT_URL = '/accounts/'
APPEND_SLASH = True

# IZI settings
from izi.defaults import * # noqa E402

IZI_DASHBOARD_NAVIGATION.append(
    {
        'label': _('Stores'),
コード例 #8
0
ファイル: conftest.py プロジェクト: izi-ecommerce/izi-stores
def pytest_configure():
    location = lambda x: os.path.join(
        os.path.dirname(os.path.realpath(__file__)), x)

    test_settings = IZI_SETTINGS.copy()
    test_settings.update(
        dict(
            DATABASES={
                'default': {
                    'ENGINE': 'django.contrib.gis.db.backends.postgis',
                    'NAME': 'izi_stores',
                }
            },
            SITE_ID=1,
            MEDIA_ROOT=location('public/media'),
            MEDIA_URL='/media/',
            STATIC_URL='/static/',
            STATICFILES_DIRS=(location('static/'), ),
            STATIC_ROOT=location('public'),
            STATICFILES_FINDERS=(
                'django.contrib.staticfiles.finders.FileSystemFinder',
                'django.contrib.staticfiles.finders.AppDirectoriesFinder',
            ),
            TEMPLATES=[{
                'BACKEND': 'django.template.backends.django.DjangoTemplates',
                'DIRS': [
                    location('templates'),
                    IZI_MAIN_TEMPLATE_DIR,
                ],
                'OPTIONS': {
                    'loaders': [
                        'django.template.loaders.filesystem.Loader',
                        'django.template.loaders.app_directories.Loader',
                    ],
                    'context_processors': [
                        'django.contrib.auth.context_processors.auth',
                        'django.template.context_processors.request',
                        'django.template.context_processors.debug',
                        'django.template.context_processors.i18n',
                        'django.template.context_processors.media',
                        'django.template.context_processors.static',
                        'django.contrib.messages.context_processors.messages',
                    ],
                }
            }],
            MIDDLEWARE_CLASSES=(
                'django.middleware.common.CommonMiddleware',
                'django.contrib.sessions.middleware.SessionMiddleware',
                'django.middleware.csrf.CsrfViewMiddleware',
                'django.contrib.auth.middleware.AuthenticationMiddleware',
                'django.contrib.messages.middleware.MessageMiddleware',
                'izi.apps.basket.middleware.BasketMiddleware',
            ),
            ROOT_URLCONF='sandbox.sandbox.urls',
            TEMPLATE_DIRS=(
                location('templates'),
                IZI_MAIN_TEMPLATE_DIR,
            ),
            INSTALLED_APPS=[
                'django.contrib.auth',
                'django.contrib.contenttypes',
                'django.contrib.sessions',
                'django.contrib.sites',
                'django.contrib.messages',
                'django.contrib.staticfiles',
                'django.contrib.admin',
                'django.contrib.gis',
                'django.contrib.flatpages',
                'widget_tweaks',
            ] + get_core_apps() + [
                'stores',
            ],
            AUTHENTICATION_BACKENDS=(
                'izi.apps.customer.auth_backends.EmailBackend',
                'django.contrib.auth.backends.ModelBackend',
            ),
            LOGIN_REDIRECT_URL='/accounts/',
            APPEND_SLASH=True,
            HAYSTACK_CONNECTIONS={
                'default': {
                    'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',
                },
            },
            GEOIP_PATH='sandbox/geoip',
            COMPRESS_ENABLED=False,
            TEST_RUNNER='django.test.runner.DiscoverRunner',
        ))

    settings.configure(**test_settings)
コード例 #9
0
 def test_raises_exception_for_string_arg(self):
     with self.assertRaises(ValueError):
         izi.get_core_apps('forks.catalogue')
コード例 #10
0
 def test_can_be_retrieved_with_overrides(self):
     apps = izi.get_core_apps(overrides=['apps.shipping'])
     self.assertTrue('apps.shipping' in apps)
     self.assertTrue('izi.apps.shipping' not in apps)
コード例 #11
0
 def test_can_be_retrieved_through_fn(self):
     core_apps = izi.get_core_apps()
     self.assertTrue('izi' in core_apps)
コード例 #12
0
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'django.contrib.staticfiles',
    # External apps
    'django_extensions',
    'debug_toolbar',
    # Apps from izi
    'paypal',
    'widget_tweaks',
]

from izi import get_core_apps

INSTALLED_APPS = INSTALLED_APPS + get_core_apps(
    ['apps.shipping', 'apps.checkout'])

AUTHENTICATION_BACKENDS = (
    'izi.apps.customer.auth_backends.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

LOGIN_REDIRECT_URL = '/accounts/'
APPEND_SLASH = True

# IZI settings
from izi.defaults import *

IZI_ALLOW_ANON_CHECKOUT = True

IZI_SHOP_TAGLINE = 'PayPal'
コード例 #13
0
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',
    'django.contrib.staticfiles',
    'paypal',
] + get_core_apps([
    'tests.shipping',
])

MIDDLEWARE = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'izi.apps.basket.middleware.BasketMiddleware',
)

DEBUG = False
HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.simple_backend.SimpleEngine',