Added page for documenting mongomock. Updated docs/guide/index.rst

This commit is contained in:
moonso 2015-12-06 11:02:26 +01:00
parent 713af133a0
commit a3886702a3
2 changed files with 22 additions and 0 deletions

View File

@ -13,3 +13,4 @@ User Guide
gridfs gridfs
signals signals
text-indexes 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)