Пример #1
0
 def test_query_dict(self):
     database = papis.database.get()
     doc = database.get_all_documents()[0]
     doc['author'] = 'test_query_dict'
     doc.save()
     database.update(doc)
     docs = database.query_dict({
         'title': doc['title'],
         'author': doc['author']
     })
     self.assertTrue(len(docs) == 1)
Пример #2
0
 def test_update(self):
     database = papis.database.get()
     doc = database.get_all_documents()[0]
     self.assertTrue(doc is not None)
     doc['title'] = 'test_update test'
     doc.save()
     database.update(doc)
     docs = database.query_dict({'title': 'test_update test'})
     self.assertTrue(len(docs) == 1)
     doc = docs[0]
     self.assertTrue(doc is not None)
     self.assertTrue(doc['title'] == 'test_update test')