Call Django manage.py command before test runs.
Run npm install TiMirLAN/karma-django-manage
In your karma config file:
- Add
django-manage
into frameworks section. - Configure plugin with
djangoManage
object.djangoManage: {commands: [], manageFile: './manage.py'},
module.exports = function (config) {
"use strict";
config.set({
basePath: '',
frameworks: ['jasmine', 'django-manage'],
files: [],
exclude: [],
djangoManage: {
virtualenvDir: './env',
commands: ['dumpdata'],
manageFile: './manage.py',
appendToFiles: ['command_that_return_filename']
silent: true
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: true
});
};
- virtualenvDir - Path to virtualenv folder. (optional)
- commands - List of
manage.py
commands, that should be executed. - appendToFiles - List of
manage.py
commands, that return filename in stdout. That filename will be added intofiles
list of carma config; - manageFile - Path to
manage.py
file. - silent - If true, there are no command output in karma console (optional).