forked from dj-stripe/dj-stripe
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runtests.py
53 lines (47 loc) · 1.36 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
import os
import sys
TESTS_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
from django.conf import settings
settings.configure(
TIME_ZONE='America/Los_Angeles',
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.postgresql_psycopg2",
"NAME": "djstripe",
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
},
},
ROOT_URLCONF="tests.test_urls",
INSTALLED_APPS=[
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sites",
"jsonfield",
"djstripe",
],
SITE_ID=1,
STRIPE_PUBLIC_KEY=os.environ.get("STRIPE_PUBLIC_KEY", ""),
STRIPE_SECRET_KEY=os.environ.get("STRIPE_SECRET_KEY", ""),
DJSTRIPE_PLANS={},
DJSTRIPE_SUBSCRIPTION_REQUIRED_EXCEPTION_URLS=(
"(admin)",
"test_url_name",
"testapp_namespaced:test_url_namespaced"
),
ACCOUNT_SIGNUP_FORM_CLASS='djstripe.forms.StripeSubscriptionSignupForm',
TEMPLATE_DIRS = [
os.path.join(TESTS_ROOT, "tests/templates"),
]
)
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner(verbosity=1)
failures = test_runner.run_tests(["."])
if failures:
sys.exit(failures)