-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
executable file
·60 lines (53 loc) · 1.48 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
54
55
56
57
58
59
60
import logging
import sys
from django.conf import settings
import django
log = logging.getLogger()
log.addHandler(logging.StreamHandler())
log.setLevel(10)
if __name__ == "__main__":
settings.configure(
DEBUG=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
},
INSTALLED_APPS=(
"django.contrib.auth",
"django.contrib.contenttypes",
"shopify_sync",
),
MIDDLEWARE_CLASSES=(),
ROOT_URLCONF="shopify_sync.tests.urls",
USE_TZ=True,
SHOPIFY_APP_API_SECRET="hush",
LOG=log,
LOGGING={
"version": 1,
"filters": {
"require_debug_true": {
"()": "django.utils.log.RequireDebugTrue",
}
},
"handlers": {
"console": {
"level": "DEBUG",
"filters": ["require_debug_true"],
"class": "logging.StreamHandler",
}
},
# "loggers": {
# "django.db.backends": {
# "level": "DEBUG",
# "handlers": ["console"],
# }
# },
},
)
django.setup()
from django.test.runner import DiscoverRunner
test_runner = DiscoverRunner()
failures = test_runner.run_tests(["shopify_sync"])
if failures:
sys.exit(failures)