def test_register_document(self): from pyramid_mongokit import register_document registry = mock.Mock() document_cls = mock.Mock() register_document(registry, document_cls)
def test_register_document(self): from pyramid_mongokit import register_document registry = mock.MagicMock() document_cls = mock.Mock() document_cls.__collection__ = 'test_document' register_document(registry, document_cls)
def includeme(config): config.include('pyramid_mongokit') register_document(config.registry, User) generate_index(config.registry, User) register_document(config.registry, Photo) generate_index(config.registry, Photo)
def includeme_mongo_connection(config): config.include("pyramid_mongokit") register_document(config.registry, [User, UserGame]) generate_index(config.registry, User, db_name="games") generate_index(config.registry, UserGame, db_name="games", collection="bingo") generate_index(config.registry, UserGame, db_name="games", collection="scrabble") generate_index(config.registry, User, db_name="another")
def includeme_single_db_connection(config): """To use single db connection, provide ``MONGO_DB_NAME`` in environment variables. ``MONGO_DB_PREFIX`` is optionnal. """ config.include('pyramid_mongokit') register_document(config.registry, [User, UserGame]) generate_index(config.registry, User) generate_index(config.registry, UserGame, collection='bingo') generate_index(config.registry, UserGame, collection='scrabble')
def includeme_single_db_connection(config): """To use single db connection, provide ``mongodb.db_name`` in your settings ini. ``mongodb.db_prefix`` is optionnal. """ config.include("pyramid_mongokit") register_document(config.registry, [User, UserGame]) generate_index(config.registry, User) generate_index(config.registry, UserGame, collection="bingo") generate_index(config.registry, UserGame, collection="scrabble")
def includeme_mongo_connection(config): config.include('pyramid_mongokit') register_document(config.registry, [User, UserGame]) generate_index(config.registry, User, db_name='games') generate_index(config.registry, UserGame, db_name='games', collection='bingo') generate_index(config.registry, UserGame, db_name='games', collection='scrabble') generate_index(config.registry, User, db_name='another')
def includeme(config): config.include('pyramid_mongokit') register_document(config.registry, Photo) generate_index(config.registry, Photo) register_document(config.registry, Report) generate_index(config.registry, Report) register_document(config.registry, User) generate_index(config.registry, User)