Example #1
0
 def test_raises_exception_for_string_arg(self):
     with self.assertRaises(ValueError):
         wshop.get_core_apps('forks.catalogue')
Example #2
0
 def test_can_be_retrieved_through_fn(self):
     core_apps = wshop.get_core_apps()
     self.assertTrue('wshop' in core_apps)
Example #3
0
 def test_can_be_retrieved_with_overrides(self):
     apps = wshop.get_core_apps(overrides=['apps.shipping'])
     self.assertTrue('apps.shipping' in apps)
     self.assertTrue('wshop.apps.shipping' not in apps)
Example #4
0
 def test_uses_dashboard_override_when_specified(self):
     apps = wshop.get_core_apps(overrides=['apps.dashboard.catalogue'])
     self.assertTrue('apps.dashboard.catalogue' in apps)
     self.assertTrue('wshop.apps.dashboard.catalogue' not in apps)
     self.assertTrue('wshop.apps.catalogue' in apps)
Example #5
0
 def test_uses_non_dashboard_override_when_specified(self):
     apps = wshop.get_core_apps(overrides=['apps.shipping'])
     self.assertTrue('apps.shipping' in apps)
     self.assertTrue('wshop.apps.shipping' not in apps)
Example #6
0
 def test_returns_core_apps_when_no_overrides_specified(self):
     apps = wshop.get_core_apps()
     self.assertEqual(wshop.WSHOP_CORE_APPS, apps)
Example #7
0
    'django.contrib.admin',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.flatpages',
    'django.contrib.staticfiles',
    'widget_tweaks',

    # contains models we need for testing
    'tests._site.model_tests_app',
    'tests._site.myauth',

    # Use a custom partner app to test overriding models.  I can't
    # find a way of doing this on a per-test basis, so I'm using a
    # global change.
] + wshop.get_core_apps(
    ['tests._site.apps.partner', 'tests._site.apps.customer'])

AUTH_USER_MODEL = 'myauth.User'

TEMPLATES = [{
    'BACKEND':
    'django.template.backends.django.DjangoTemplates',
    'DIRS': [
        location('_site/templates'),
        wshop.WSHOP_MAIN_TEMPLATE_DIR,
    ],
    'OPTIONS': {
        'loaders': [
            ('django.template.loaders.cached.Loader', [
                'django.template.loaders.filesystem.Loader',
                'django.template.loaders.app_directories.Loader',
Example #8
0
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.admin',
    'django.contrib.flatpages',
    'django.contrib.staticfiles',
    'django.contrib.sitemaps',
    'django_extensions',

    # Debug toolbar + extensions
    'debug_toolbar',
    'apps.gateway',  # For allowing dashboard access
    'widget_tweaks',
] + wshop.get_core_apps()

# Add Wshop's custom auth backend so users can sign in using their email
# address.
AUTHENTICATION_BACKENDS = (
    'wshop.apps.customer.auth_backends.EmailBackend',
    'django.contrib.auth.backends.ModelBackend',
)

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME':
        'django.contrib.auth.password_validation.MinimumLengthValidator',
        'OPTIONS': {
            'min_length': 9,
        }