diff --git a/cms/envs/test.py b/cms/envs/test.py index 068bd39c43..ba728025a9 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -59,6 +59,14 @@ STATICFILES_DIRS += [ if os.path.isdir(COMMON_TEST_DATA_ROOT / course_dir) ] +# Avoid having to run collectstatic before the unit test suite +# If we don't add these settings, then Django templates that can't +# find pipelined assets will raise a ValueError. +# http://stackoverflow.com/questions/12816941/unit-testing-with-django-pipeline +STATICFILES_STORAGE='pipeline.storage.NonPackagingPipelineStorage' +STATIC_URL = "/static/" +PIPELINE_ENABLED=False + # Add split as another store for testing MODULESTORE['default']['OPTIONS']['stores'].append( { diff --git a/lms/envs/test.py b/lms/envs/test.py index 62b5002239..c1fa7826ef 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -109,6 +109,13 @@ STATICFILES_DIRS += [ if os.path.isdir(COMMON_TEST_DATA_ROOT / course_dir) ] +# Avoid having to run collectstatic before the unit test suite +# If we don't add these settings, then Django templates that can't +# find pipelined assets will raise a ValueError. +# http://stackoverflow.com/questions/12816941/unit-testing-with-django-pipeline +STATICFILES_STORAGE='pipeline.storage.NonPackagingPipelineStorage' +PIPELINE_ENABLED=False + update_module_store_settings( MODULESTORE, module_store_options={ diff --git a/pavelib/utils/test/suites/nose_suite.py b/pavelib/utils/test/suites/nose_suite.py index fa48bf1e1b..bdb83c92a6 100644 --- a/pavelib/utils/test/suites/nose_suite.py +++ b/pavelib/utils/test/suites/nose_suite.py @@ -99,12 +99,6 @@ class SystemTestSuite(NoseTestSuite): def __enter__(self): super(SystemTestSuite, self).__enter__() - if not self.fasttest: - # TODO: Fix the tests so that collectstatic isn't needed ever - # add --skip-collect to this when the tests are fixed - args = [self.root, '--settings=test'] - call_task('pavelib.assets.update_assets', args=args) - @property def cmd(self): cmd = (