"Bad float value: %r" % obj)
+MANDATORY_CELERY_IMPORTS = ['mediagoblin.process_media']
+
DEFAULT_SETTINGS_MODULE = 'mediagoblin.celery_setup.dummy_settings_module'
def setup_celery_from_config(app_config, global_config,
value = aslist(value)
celery_settings[key] = value
+ # add mandatory celery imports
+ celery_imports = celery_settings.setdefault('CELERY_IMPORTS', [])
+ celery_imports.extend(MANDATORY_CELERY_IMPORTS)
+
__import__(settings_module)
this_module = sys.modules[settings_module]
assert isinstance(fake_celery_module.CELERYD_ETA_SCHEDULER_PRECISION, float)
assert fake_celery_module.CELERY_RESULT_PERSISTENT is True
assert fake_celery_module.CELERY_IMPORTS == [
- 'foo.bar.baz', 'this.is.an.import']
+ 'foo.bar.baz', 'this.is.an.import', 'mediagoblin.process_media']
assert fake_celery_module.CELERY_MONGODB_BACKEND_SETTINGS == {
'database': 'mediagoblin'}
assert fake_celery_module.CELERY_RESULT_BACKEND == 'mongodb'
assert isinstance(fake_celery_module.CELERYD_ETA_SCHEDULER_PRECISION, float)
assert fake_celery_module.CELERY_RESULT_PERSISTENT is False
assert fake_celery_module.CELERY_IMPORTS == [
- 'baz.bar.foo', 'import.is.a.this']
+ 'baz.bar.foo', 'import.is.a.this', 'mediagoblin.process_media']
assert fake_celery_module.CELERY_MONGODB_BACKEND_SETTINGS == {
'database': 'captain_lollerskates',
'host': 'mongodb.example.org',