def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def test_exceptions(self):
        self.assert_(issubclass(DeoptionError, TypeError))
        self.assertRaises(TypeError,
            lambda: Optional()
        )
        self.assertRaises(TypeError,
            lambda: Optional(NotPassed, NotPassed)
        )