Exemplo n.º 1
0
    def setUp(self):
        BaseTestCase.setUp(self)
        
        db = get_mongo_db()
        self.db = db.client["widukind_test"] 
        
        self.assertEqual(self.db.name, "widukind_test")

        utils.clean_mongodb(self.db)
                
        create_or_update_indexes(self.db, force_mode=True)
Exemplo n.º 2
0
def cmd_clean(**kwargs):
    """Delete All MongoDB collections"""

    ctx = client.Context(**kwargs)
    #TODO: translation
    ctx.log_warn("La destruction des données est définitive !")

    if ctx.silent or click.confirm('Do you want to continue?', abort=True):

        db = ctx.mongo_database()

        utils.clean_mongodb(db)
Exemplo n.º 3
0
def cmd_clean(**kwargs):
    """Delete All MongoDB collections"""

    ctx = client.Context(**kwargs)
    #TODO: translation
    ctx.log_warn("La destruction des données est définitive !")
    
    if ctx.silent or click.confirm('Do you want to continue?', abort=True):
    
        db = ctx.mongo_database()
        
        utils.clean_mongodb(db)
Exemplo n.º 4
0
    def setUp(self):
        BaseTestCase.setUp(self)

        from widukind_common.utils import get_mongo_db, create_or_update_indexes
        from widukind_common import tests_tools as utils
        
        db = get_mongo_db()
        self.db = db.client["widukind_test"] 
        
        self.assertEqual(self.db.name, "widukind_test")

        utils.clean_mongodb(self.db)
                
        create_or_update_indexes(self.db, force_mode=True)

        self._collections_is_empty()
Exemplo n.º 5
0
 def clean_db(self):
     utils.clean_mongodb(collection_list=constants.COL_ALL, db=self.db)
Exemplo n.º 6
0
 def setUp(self):
     super().setUp()
     self.db = self.app.widukind_db
     self.assertEqual(self.db.name, "widukind_test")
     utils.clean_mongodb(self.db)
     create_or_update_indexes(self.db, force_mode=True)
Exemplo n.º 7
0
 def setUp(self):
     super().setUp()
     self.db = self.app.widukind_db
     self.assertEqual(self.db.name, "widukind_test")
     utils.clean_mongodb(self.db)
     create_or_update_indexes(self.db, force_mode=True)
Exemplo n.º 8
0
 def clean_db(self):
     utils.clean_mongodb(db=self.db)
Exemplo n.º 9
0
 def clean_db(self):
     utils.clean_mongodb(collection_list=constants.COL_ALL, db=self.db)