def test_config_check(self): from django.core.checks import Error from webpack_loader.apps import webpack_cfg_check from webpack_loader.errors import BAD_CONFIG_ERROR with self.settings(WEBPACK_LOADER={"BUNDLE_DIR_NAME": "bundles/", "STATS_FILE": "webpack-stats.json"}): errors = webpack_cfg_check(None) expected_errors = [BAD_CONFIG_ERROR] self.assertEqual(errors, expected_errors) with self.settings(WEBPACK_LOADER={"DEFAULT": {}}): errors = webpack_cfg_check(None) expected_errors = [] self.assertEqual(errors, expected_errors)
def test_config_check(self): from webpack_loader.apps import webpack_cfg_check from webpack_loader.errors import BAD_CONFIG_ERROR with self.settings(WEBPACK_LOADER={ 'BUNDLE_DIR_NAME': 'bundles/', 'STATS_FILE': 'webpack-stats.json', }): errors = webpack_cfg_check(None) expected_errors = [BAD_CONFIG_ERROR] self.assertEqual(errors, expected_errors) with self.settings(WEBPACK_LOADER={'DEFAULT': {}}): errors = webpack_cfg_check(None) expected_errors = [] self.assertEqual(errors, expected_errors)
def test_config_check(self): from webpack_loader.apps import webpack_cfg_check from webpack_loader.errors import BAD_CONFIG_ERROR with self.settings(WEBPACK_LOADER={ 'BUNDLE_DIR_NAME': 'bundles/', 'STATS_FILE': 'webpack-stats.json', }): errors = webpack_cfg_check(None) expected_errors = [BAD_CONFIG_ERROR] self.assertEqual(errors, expected_errors) with self.settings(WEBPACK_LOADER={ 'DEFAULT': {} }): errors = webpack_cfg_check(None) expected_errors = [] self.assertEqual(errors, expected_errors)