'Name in client means display_name in database.'

@mock.patch('cinder.volume.api.API.get_all')
def test_get_volumes_sort_by_name(self, get_all):

    req = mock.MagicMock()
    ctxt = context.RequestContext(fake.USER_ID, fake.PROJECT_ID, auth_token=True)
    req.environ = {'cinder.context': ctxt}
    req.params = {'sort': 'name'}
    self.controller._view_builder.detail_list = mock.Mock()
    self.controller._get_volumes(req, True)
    get_all.assert_called_once_with(ctxt, None, CONF.osapi_max_limit, sort_dirs=['desc'], viewable_admin_meta=True, sort_keys=['display_name'], filters={}, offset=0)
