Пример #1
0
 def MongoUpdate(self):
     """Update record in MongoDB and check"""
     db = Mongo(0)
     db_insert = db.insert({
         'session': 'UpdateTest',
         'data': 'Update Test data'
     })
     db_update = db.update({
         'session': 'UpdateTest',
         'data': 'Test data Updated'
     })
     db_fetch = db.fetch({'session': 'UpdateTest', 'data': ''})
     return self.assertEqual('Test data Updated', db_fetch['data'])
Пример #2
0
 def MongoInsert(self):
     """Insert record in MongoDB and check"""
     db = Mongo(0)
     db_insert = db.insert({'session': 'MongoTest', 'data': 'Test data'})
     db_fetch = db.fetch({'session': 'MongoTest', 'data': 'Test data'})
     return self.assertEqual('MongoTest', db_fetch['session'])