Merge pull request #1180 from moonso/add-mongomock-docs

Added page for documenting mongomock. Updated docs/guide/index.rst
This commit is contained in:
Omer Katz 2015-12-06 13:23:04 +02:00
commit 2dd70c8d62
2 changed files with 22 additions and 0 deletions

View File

@ -13,3 +13,4 @@ User Guide
gridfs
signals
text-indexes
mongomock

21
docs/guide/mongomock.rst Normal file
View File

@ -0,0 +1,21 @@
==============================
Use mongomock for testing
==============================
`mongomock <https://github.com/vmalloc/mongomock/>`_ is a package to do just
what the name implies, mocking a mongo database.
To use with mongoengine, simply specify mongomock when connecting with
mongoengine:
.. code-block:: python
connect('mongoenginetest', host='mongomock://localhost')
conn = get_connection()
or with an alias:
.. code-block:: python
connect('mongoenginetest', host='mongomock://localhost', alias='testdb')
conn = get_connection('testdb)