Add test for gnuviechadmin.celery

This commit adds a refactoring for gnuviechadmin.celery to make the
installed apps detection testable. The test is added in
gnuviechadmin.tests.test_celery. Debug code in gnuviechadmin.urls is no
excluded from coverage reporting.
This commit is contained in:
Jan Dittberner 2015-11-22 14:31:04 +01:00
parent 7bcb0d3100
commit be0531ec30
3 changed files with 15 additions and 2 deletions

View file

@ -12,5 +12,8 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE',
app = Celery('gnuviechadmin')
def get_installed_apps():
return settings.INSTALLED_APPS
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
app.autodiscover_tasks(get_installed_apps)