'Test that missing required settings in JSON object will result in the appropriate error message'

@mock.patch('contentstore.management.commands.generate_courses.logger')
@ddt.data('organization', 'number', 'run', 'fields')
def test_missing_course_settings(self, setting, mock_logger):

    settings = {'courses': [{'organization': 'test-course-generator', 'number': '1', 'run': '1', 'user': str(self.user.email), 'fields': {'display_name': 'test-course'}}]}
    del settings['courses'][0][setting]
    arg = json.dumps(settings)
    call_command('generate_courses', arg)
    mock_logger.warning.assert_any_call(('Course    json    is    missing    ' + setting))
