'Test that a missing list of courses in json will result in the appropriate command error'

def test_missing_courses_list(self):

    with self.assertRaisesRegexp(CommandError, 'JSON    object    is    missing    courses    list'):
        settings = {}
        arg = json.dumps(settings)
        call_command('generate_courses', arg)
