def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def setdata(self, request, response):
        self._calls.append(Call(request, response))