Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function(assert) {
"Throws an error when trying to use a bad root URLConf";
conf.setSettings({
'ROOT_URLCONF':'dne.dne.dne'
});
assert.throws(Error, function() {
urls.getRoot();
});
conf.setSettings({
'ROOT_URLCONF':undefined
});
},
function(assert) {
exports.runcommand = function() {
var sys = require('sys'),
conf = require('wilson/conf'),
core = require('wilson/core/app'),
application = require('wilson/application'),
app_and_command = process.argv[2].split(':'),
app = app_and_command[0],
command = app_and_command[1],
appInstance;
try {
application.loadApps(conf.settings.APP_OVERRIDES);
appInstance = application.getApplicationInstance(app);
} catch(err) {
conf.setSettings({
INSTALLED_APPS:{
core:application.use('wilson/core')
},
TEMPLATE_LOADERS:[
'wilson/template/loaders.application',
'wilson/template/loaders.filesystem',
],
});
application.loadApps(conf.settings.APP_OVERRIDES);
appInstance = application.getApplicationInstance('core');
}
if(appInstance) {
var appCommand = appInstance.app.commands[command];
if(appCommand) {
appCommand.apply(appInstance, process.argv.slice(3));