| 1 | import os |
| 2 | |
| 3 | from celery import Celery |
| 4 | |
| 5 | app = Celery('celery_haystack') |
| 6 | app.config_from_object('django.conf:settings') |
| 7 | |
| 8 | |
| 9 | DEBUG = True |
| 10 | |
| 11 | TEST_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), 'tests')) |
| 12 | |
| 13 | INSTALLED_APPS = [ |
| 14 | 'haystack', |
| 15 | 'celery_haystack', |
| 16 | 'celery_haystack.tests', |
| 17 | ] |
| 18 | |
| 19 | DATABASES = { |
| 20 | 'default': { |
| 21 | 'ENGINE': 'django.db.backends.sqlite3', |
| 22 | 'NAME': ':memory:', |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | SECRET_KEY = 'really-not-secret' |
| 27 | |
| 28 | BROKER_TRANSPORT = "memory" |
| 29 | CELERY_ALWAYS_EAGER = True |
| 30 | CELERY_IGNORE_RESULT = True |
| 31 | CELERYD_LOG_LEVEL = "DEBUG" |
| 32 | CELERY_DEFAULT_QUEUE = "celery-haystack" |
| 33 | |
| 34 | HAYSTACK_CONNECTIONS = { |
| 35 | 'default': { |
| 36 | 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', |
| 37 | 'PATH': os.path.join(TEST_ROOT, 'whoosh_index'), |
| 38 | } |
| 39 | } |
| 40 | HAYSTACK_SIGNAL_PROCESSOR = 'celery_haystack.signals.CelerySignalProcessor' |