-
Notifications
You must be signed in to change notification settings - Fork 8
/
test.py
36 lines (31 loc) · 1.2 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
import os, sys
from django.conf import settings
import django
try:
from facebook_api_key import FACEBOOK_ACCESS_TOKEN, FACEBOOK_APP_ID, FACEBOOK_PAGE_ID
except:
print ("You'l need a facebook api key to test this module. Put it in facebook_api_key.py")
sys.exit(-1)
settings.configure(DEBUG=True,
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
ROOT_URLCONF='myapp.urls',
FACEBOOK_ACCESS_TOKEN=FACEBOOK_ACCESS_TOKEN,
FACEBOOK_APP_ID=FACEBOOK_APP_ID,
FACEBOOK_PAGE_ID=FACEBOOK_PAGE_ID,
REDDIT_BOT_USER_AGENT='dewDrop Bot 0.1',
REDDIT_BOT_SUBREDDIT='dewDropLanguage',
INSTALLED_APPS=('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'drops',))
from django.test.runner import DiscoverRunner
django.setup()
test_runner = DiscoverRunner(verbosity=1)
failures = test_runner.run_tests(['drops'])
if failures:
sys.exit(failures)