def _setup_share_group_data(self, share_group=None, version='2.31'): if share_group is None: share_group = db_utils.create_share_group( status=constants.STATUS_AVAILABLE) path = '/v2/fake/share-groups/%s/action' % share_group['id'] req = fakes.HTTPRequest.blank(path, script_name=path, version=version) req.headers[wsgi.API_VERSION_REQUEST_HEADER] = version req.headers[wsgi.EXPERIMENTAL_API_REQUEST_HEADER] = 'True' return share_group, req