'Test that providing an invalid user in the course JSON will result in the appropriate error message'

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

    settings = {'courses': [{'organization': 'test-course-generator', 'number': '1', 'run': '1', 'user': 'invalid_user', 'fields': {'display_name': 'test-course'}}]}
    arg = json.dumps(settings)
    call_command('generate_courses', arg)
    mock_logger.warning.assert_any_call('invalid_user    user    does    not    exist')
