Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ User Guide
gridfs
signals
text-indexes
mongomock
21 changes: 21 additions & 0 deletions docs/guide/mongomock.rst
Original file line number Diff line number Diff line change
@@ -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)