|
|
@@ -3,81 +3,7 @@ import sys
|
|
3
|
3
|
import os
|
|
4
|
4
|
from optparse import OptionParser
|
|
5
|
5
|
|
|
6
|
|
-from django.conf import settings, global_settings
|
|
7
|
|
-
|
|
8
|
|
-if not settings.configured:
|
|
9
|
|
- from oscar.defaults import *
|
|
10
|
|
- oscar_settings = dict([(k, v) for k, v in locals().items() if k.startswith('OSCAR_')])
|
|
11
|
|
-
|
|
12
|
|
- # Helper function to extract absolute path
|
|
13
|
|
- location = lambda x: os.path.join(os.path.dirname(os.path.realpath(__file__)), x)
|
|
14
|
|
-
|
|
15
|
|
- settings.configure(
|
|
16
|
|
- DATABASES={
|
|
17
|
|
- 'default': {
|
|
18
|
|
- 'ENGINE': 'django.db.backends.sqlite3',
|
|
19
|
|
- }
|
|
20
|
|
- },
|
|
21
|
|
- INSTALLED_APPS=[
|
|
22
|
|
- 'django.contrib.auth',
|
|
23
|
|
- 'django.contrib.admin',
|
|
24
|
|
- 'django.contrib.contenttypes',
|
|
25
|
|
- 'django.contrib.sessions',
|
|
26
|
|
- 'django.contrib.sites',
|
|
27
|
|
- # Oscar apps
|
|
28
|
|
- 'oscar',
|
|
29
|
|
- 'oscar.apps.analytics',
|
|
30
|
|
- 'oscar.apps.discount',
|
|
31
|
|
- 'oscar.apps.order',
|
|
32
|
|
- 'oscar.apps.checkout',
|
|
33
|
|
- 'oscar.apps.shipping',
|
|
34
|
|
- 'oscar.apps.catalogue',
|
|
35
|
|
- 'oscar.apps.catalogue.reviews',
|
|
36
|
|
- 'oscar.apps.basket',
|
|
37
|
|
- 'oscar.apps.payment',
|
|
38
|
|
- 'oscar.apps.offer',
|
|
39
|
|
- 'oscar.apps.address',
|
|
40
|
|
- 'oscar.apps.partner',
|
|
41
|
|
- 'oscar.apps.customer',
|
|
42
|
|
- 'oscar.apps.promotions',
|
|
43
|
|
- 'oscar.apps.search',
|
|
44
|
|
- 'oscar.apps.voucher',
|
|
45
|
|
- 'oscar.apps.dashboard',
|
|
46
|
|
- 'oscar.apps.dashboard.reports',
|
|
47
|
|
- 'oscar.apps.dashboard.users',
|
|
48
|
|
- 'oscar.apps.dashboard.orders'
|
|
49
|
|
- ],
|
|
50
|
|
- TEMPLATE_CONTEXT_PROCESSORS=(
|
|
51
|
|
- "django.contrib.auth.context_processors.auth",
|
|
52
|
|
- "django.core.context_processors.request",
|
|
53
|
|
- "django.core.context_processors.debug",
|
|
54
|
|
- "django.core.context_processors.i18n",
|
|
55
|
|
- "django.core.context_processors.media",
|
|
56
|
|
- "django.core.context_processors.static",
|
|
57
|
|
- "django.contrib.messages.context_processors.messages",
|
|
58
|
|
- 'oscar.apps.search.context_processors.search_form',
|
|
59
|
|
- 'oscar.apps.promotions.context_processors.promotions',
|
|
60
|
|
- 'oscar.apps.checkout.context_processors.checkout',
|
|
61
|
|
- ),
|
|
62
|
|
- TEMPLATE_DIRS=(
|
|
63
|
|
- location('tests/templates'),
|
|
64
|
|
- ),
|
|
65
|
|
- MIDDLEWARE_CLASSES=global_settings.MIDDLEWARE_CLASSES + (
|
|
66
|
|
- 'oscar.apps.basket.middleware.BasketMiddleware',
|
|
67
|
|
- ),
|
|
68
|
|
- AUTHENTICATION_BACKENDS=(
|
|
69
|
|
- 'oscar.apps.customer.auth_backends.Emailbackend',
|
|
70
|
|
- 'django.contrib.auth.backends.ModelBackend',
|
|
71
|
|
- ),
|
|
72
|
|
- ROOT_URLCONF='tests.urls',
|
|
73
|
|
- LOGIN_REDIRECT_URL='/accounts/',
|
|
74
|
|
- DEBUG=False,
|
|
75
|
|
- SITE_ID=1,
|
|
76
|
|
- HAYSTACK_SEARCH_ENGINE='dummy',
|
|
77
|
|
- HAYSTACK_SITECONF = 'oscar.search_sites',
|
|
78
|
|
- APPEND_SLASH=True,
|
|
79
|
|
- **oscar_settings
|
|
80
|
|
- )
|
|
|
6
|
+import tests.config
|
|
81
|
7
|
|
|
82
|
8
|
from django.test.simple import DjangoTestSuiteRunner
|
|
83
|
9
|
|