def new_connection(): from example.model import User, Photo db_prefix = '' connection = SingleDbConnection(os.environ['MONGO_DB_NAME'], db_prefix, os.environ['MONGO_URI']) connection.register(User) connection.register(Photo) connection.generate_index(User) connection.generate_index(Photo) return connection
def remove_test_database(): from pyramid_mongokit import SingleDbConnection connection = SingleDbConnection(os.environ['MONGO_DB_NAME'], '', os.environ['MONGO_URI']) connection.drop_database(os.environ['MONGO_DB_NAME'])