-
Notifications
You must be signed in to change notification settings - Fork 23
/
runtests.py
40 lines (32 loc) · 975 Bytes
/
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
#!/usr/bin/env python
import os
import sys
import logging
from django.conf import settings
settings.configure(
DATABASES={
'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory;'}
},
INSTALLED_APPS=[
'haystack',
'queued_search',
'tests',
],
HAYSTACK_CONNECTIONS={
'default': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index')
}
},
HAYSTACK_SIGNAL_PROCESSOR='queued_search.signals.QueuedSignalProcessor',
QUEUE_BACKEND='dummy',
SEARCH_QUEUE_LOG_LEVEL=logging.DEBUG
)
def runtests(*test_args):
import django.test.utils
runner_class = django.test.utils.get_runner(settings)
test_runner = runner_class(verbosity=1, interactive=True, failfast=False)
failures = test_runner.run_tests(['tests'])
sys.exit(failures)
if __name__ == '__main__':
runtests()