Пример #1
0
 def test_doc_update_fails_with_wrong_rev(self):
     # create a document in shared db
     doc_id = 'some-random-doc'
     self.assertIsNone(self._db.get_doc(doc_id))
     # create a document in shared db
     doc = SoledadDocument(doc_id=doc_id)
     self._db.put_doc(doc)
     # try to update document without including revision of old version
     doc.rev = 'wrong-rev'
     self.assertRaises(RevisionConflict, self._db.put_doc, doc)
Пример #2
0
 def test_doc_update_fails_with_wrong_rev(self):
     # create a document in shared db
     doc_id = 'some-random-doc'
     self.assertIsNone(self._db.get_doc(doc_id))
     # create a document in shared db
     doc = SoledadDocument(doc_id=doc_id)
     self._db.put_doc(doc)
     # try to update document without including revision of old version
     doc.rev = 'wrong-rev'
     self.assertRaises(RevisionConflict, self._db.put_doc, doc)