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

@mock.patch('contentstore.management.commands.generate_courses.logger')
def test_missing_display_name(self, mock_logger):

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