def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def stop(self):
        self._patcher.stop()
        self._patcher2.stop()
        self._server_mock = None