Пример #1
0
    def tearDown(self):
        db.session.remove()
        db.drop_all()

        # Removing test collections from mongo.
        cli = pymongo.MongoClient(host=os.getenv('MONGO_HOST'),port=int(mhn.config['MONGO_PORT']),True if os.getenv('MONGO_AUTH') == 'true' else False,os.getenv('MONGO_USER'),os.getenv('MONGO_PASSWORD'),os.getenv('MONGO_AUTH_MECHANISM'))
        for dbname in cli.database_names():
            if dbname.startswith('test_'):
                cli.drop_database(dbname)
Пример #2
0
    def tearDown(self):
        db.session.remove()
        db.drop_all()

        # Removing test collections from mongo.
        cli = pymongo.MongoClient()
        for dbname in cli.database_names():
            if dbname.startswith("test_"):
                cli.drop_database(dbname)
Пример #3
0
    def tearDown(self):
        db.session.remove()
        db.drop_all()

        # Removing test collections from mongo.
        cli = pymongo.MongoClient()
        for dbname in cli.database_names():
            if dbname.startswith('test_'):
                cli.drop_database(dbname)
Пример #4
0
    def tearDown(self):
        db.session.remove()
        db.drop_all()

        # Removing test collections from mongo.
        cli = pymongo.MongoClient(
            host=os.getenv('MONGO_HOST'),
            port=int(mhn.config['MONGO_PORT']),
            True if os.getenv('MONGO_AUTH') == 'true' else False,
            os.getenv('MONGO_USER'),
            os.getenv('MONGO_PASSWORD'),
            os.getenv('MONGO_AUTH_MECHANISM'))
        for dbname in cli.database_names():
            if dbname.startswith('test_'):
                cli.drop_database(dbname)