forked from spookylukey/django-paypal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.py
executable file
·88 lines (80 loc) · 3.03 KB
/
runtests.py
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
82
83
84
85
86
87
88
#!/usr/bin/env python
from __future__ import unicode_literals
import sys
import warnings
from django.conf import settings
from django.core.management import execute_from_command_line
warnings.simplefilter("always", PendingDeprecationWarning)
warnings.simplefilter("always", DeprecationWarning)
settings.configure(
ROOT_URLCONF='',
DATABASES={'default': {'ENGINE': 'django.db.backends.sqlite3'}},
PAYPAL_TEST=True,
# Please dont make me create another test account and remove this from here :)
PAYPAL_WPP_USER='django.paypal.seller_api1.gmail.com',
PAYPAL_WPP_PASSWORD='D5LBCTEKUUJR8EKL',
PAYPAL_WPP_SIGNATURE='AFcWxV21C7fd0v3bYYYRCpSSRl31A6nHqN3IBok0TF-H8I-C8C6u41Do',
PAYPAL_IDENTITY_TOKEN='xxx',
INSTALLED_APPS=[
'django.contrib.auth',
'django.contrib.admin',
'django.contrib.sessions',
'django.contrib.contenttypes',
'paypal.pro',
'paypal.standard',
'paypal.standard.ipn',
'paypal.standard.pdt',
],
CACHES={
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
'TIMEOUT': 0,
'KEY_PREFIX': 'paypal_tests_',
}
},
MIDDLEWARE_CLASSES=[
"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",
],
MIDDLEWARE=[
"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",
],
TEMPLATES=[ # Django 1.8 and later
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.contrib.auth.context_processors.auth',
'django.template.context_processors.debug',
'django.template.context_processors.i18n',
'django.template.context_processors.media',
'django.template.context_processors.static',
'django.template.context_processors.tz',
'django.contrib.messages.context_processors.messages',
],
},
},
],
USE_TZ=True,
)
argv = [sys.argv[0], "test"]
if len(sys.argv) == 1:
# Nothing following 'runtests.py':
argv.extend(["paypal.pro.tests", "paypal.standard.ipn.tests", "paypal.standard.pdt.tests"])
else:
# Allow tests to be specified:
argv.extend(sys.argv[1:])
if __name__ == '__main__':
execute_from_command_line(argv)