Ejemplo n.º 1
0
 def test_delete(self):
     obj = {"abc": "1234", "def": "4567"}
     selector = {"abc": "1234"}
     db = Couch('test')
     db.distinct_insert(obj)
     query_result = db.query(selector)
     self.assertTrue(len(query_result) > 0)
     db.delete(selector)
     query_result = db.query(selector)
     self.assertEqual(0, len(query_result))
Ejemplo n.º 2
0
 def test_retrieve_flickr_realtime_not_in_db(self):
     selector = {'profile': {'username': '******'}}
     db = Couch('flickr')
     db.delete(selector)
     db.close()
     account = {'platform': 'Flickr', 'account': 'sakuranyochan'}
     retrieve(account, REALTIME_MODE)
     db = Couch('flickr')
     query_result = db.query({'profile': {'username': '******'}})
     db.close()
     for item in query_result:
         self.assertTrue('profile' in item.keys()
                         and item['profile']['username'] == 'sakuranyochan')