Beispiel #1
0
 def mongo_client(self):
     if not self.client_mongo:
         self.client_mongo = get_mongo_client(self.mongo_url)
     return self.client_mongo
Beispiel #2
0
 def mongo_client(self):
     if not self.client_mongo:
         self.client_mongo = get_mongo_client(self.mongo_url.strip('"'))
     return self.client_mongo
Beispiel #3
0
 def init_mongo_client(self):
     if 'USE_MONGO_SERVER' in os.environ:
         self.mongo_client = get_mongo_client()
         self.addCleanup(self.mongo_client.close)
     else:
         self.mongo_client = mongomock.MongoClient(connect=False)