aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/celery_setup/from_tests.py
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-06-26 14:45:19 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-06-26 14:45:19 -0500
commit9ea5c28b7a3bb74cebd923353b9e4c780e658d74 (patch)
treedb6b94000136f160b703fbc1a2cb5a71a5cc1c8c /mediagoblin/celery_setup/from_tests.py
parent426685e088cd1867c12fc2721d2430e1be335297 (diff)
downloadmediagoblin-9ea5c28b7a3bb74cebd923353b9e4c780e658d74.tar.lz
mediagoblin-9ea5c28b7a3bb74cebd923353b9e4c780e658d74.tar.xz
mediagoblin-9ea5c28b7a3bb74cebd923353b9e4c780e658d74.zip
Celery wasn't really being properly connected during tests.
Lots of fixes to do this. - setup_celery_from_config no longer responsible for checking 'celery_setup_elsewhere'; that's the app's job. (This was a problem because more than the app was relying on using this function) - Allow us to specifically set the config file we're setting up celery from with setup_self - Set up celery_always_eager. This is something we strongly want while doing tests. - Instead of setting up the app in the get_test_app method, let's set that up simply by importing from_tests, which should itself up via from_celery being the environment variable being set.
Diffstat (limited to 'mediagoblin/celery_setup/from_tests.py')
-rw-r--r--mediagoblin/celery_setup/from_tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mediagoblin/celery_setup/from_tests.py b/mediagoblin/celery_setup/from_tests.py
index 43032f41..0f305df2 100644
--- a/mediagoblin/celery_setup/from_tests.py
+++ b/mediagoblin/celery_setup/from_tests.py
@@ -16,11 +16,15 @@
import os
+from mediagoblin.tests.tools import TEST_APP_CONFIG
from mediagoblin.celery_setup.from_celery import setup_self
OUR_MODULENAME = __name__
+CELERY_SETUP = False
if os.environ.get('CELERY_CONFIG_MODULE') == OUR_MODULENAME:
- setup_self(check_environ_for_conf=False, module_name=OUR_MODULENAME)
+ setup_self(check_environ_for_conf=False, module_name=OUR_MODULENAME,
+ default_conf_file=TEST_APP_CONFIG)
+ CELERY_SETUP = True