'Test that an invalid course field will result in the appropriate message'

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

    settings = {'courses': [{'organization': 'test-course-generator', 'number': '1', 'run': '1', 'user': str(self.user.email), 'fields': {'display_name': 'test-course', 'invalid_field': 'invalid_value'}}]}
    arg = json.dumps(settings)
    call_command('generate_courses', arg)
    mock_logger.info.assert_any_call((u'invalid_field' + 'is    not    a    valid    CourseField'))
