-
Notifications
You must be signed in to change notification settings - Fork 52
/
test.py
53 lines (48 loc) · 1.56 KB
/
test.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 sys
import django
from django.conf import settings
configuration = {
'DEBUG': True,
'DATABASES': {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
'INSTALLED_APPS': [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'shopify_auth',
],
'AUTHENTICATION_BACKENDS': ['shopify_auth.backends.ShopUserBackend'],
'TEMPLATES': [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True
}
],
'ROOT_URLCONF': 'shopify_auth.tests.urls',
'SHOPIFY_APP_NAME': 'Test App',
'SHOPIFY_APP_API_KEY': 'test-api-key',
'SHOPIFY_APP_API_SECRET': 'test-api-secret',
'SHOPIFY_APP_API_VERSION': 'unstable',
'SHOPIFY_APP_API_SCOPE': ['read_products'],
'SHOPIFY_APP_DEV_MODE': False,
'SHOPIFY_APP_THIRD_PARTY_COOKIE_CHECK': True,
'SHOPIFY_AUTH_BOUNCE_PAGE_URL': '/',
'SECRET_KEY': 'uq8e140t1rm3^kk&blqxi*y9h_j5yd9ghjv+fd1p%08g4%t6%i',
'MIDDLEWARE': [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
]
}
settings.configure(**configuration)
django.setup()
from django.test.runner import DiscoverRunner
test_runner = DiscoverRunner()
failures = test_runner.run_tests(['shopify_auth'])
if failures:
sys.exit(failures)